Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - Do a search bar for ios or android

Tags:

reactjs

native

I've been searching for a search bar component for ios and android so i can use in my app. So far I have found none, that's why I want to make one. How can I show a view when I click a button? So when they click the search icon, the search bar appears. Or any way to do a search bar? Thank you!

like image 257
user2849167 Avatar asked Apr 25 '26 06:04

user2849167


2 Answers

There are many tutorials available on Internet`

Some of them

var SearchBar = require('react-native-search-bar');

and

<SearchBar
ref='searchBar'
placeholder='Search'
onChangeText={...}
onSearchButtonPress={...}
onCancelButtonPress={...}
/>

Some useful links

  • https://github.com/umhan35/react-native-search-bar

  • https://www.npmjs.com/package/react-native-search

  • https://github.com/StevenIseki/react-native-search/tree/master/SearchBarExample
  • https://www.briandouglas.me/2016/02/08/searching-data-in-react-native

enter image description here

enter image description here

like image 50
Vishwesh Jainkuniya Avatar answered Apr 27 '26 22:04

Vishwesh Jainkuniya


react-native-elements 1.0.0-beta5 has a component for both iOS and Android searchbars. The current version SearchBar works with Android too but is without the Android style.

npm install --save [email protected]

<SearchBar
   showLoading
   platform="android"
   placeholder='Search' />

Then it looks like this: Android

like image 21
Bostrot Avatar answered Apr 27 '26 20:04

Bostrot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!