React Search Bar
npm install search-bar-reactInstagram-inspired react search bar.
Default:

Mobile:

npm install search-bar-react --save
``jsx
import SearchBar from 'search-bar-react'
...
onFocus={() => console.log('focused')}
size='large'
width='100%'
autoFocus
placeholder='Search...'
onClear={() => console.log('closed')}
value='Initial Value'
/>
...
onClear={() => console.log('cleared')}
/>
...
`
| Prop | Type | Default | Description |
|-|-|-|-|
| __mobile__ | Boolean | false | _Use the mobile style version._ |string
| __value__ | | '' | _Initial Value._ |string
| __placeholder__ | | 'Search' | _Search Bar custom placeholder._ |string
| __clearBtnText__ | | 'Clear' | _(mobile version only) custom clear text._ |string
| __width__ | | '280px' | _Set custom width._ |string
| __size__ | | 'default' | _Select a predefined size ['small','large']_ |Boolean
| __loading__ | | | _Control loading button behavior. As default the loading button spins for a second after user input._ |Boolean
| __autoFocus__ | | false | _Autofocus on mount._ |function
| __onChange__ | | | _Callback on input change. Returns string._ |function
| __onFocus__ | | | _Callback on input focus._ |function` | | _Callback on Clear-Button click._ |
| __onClear__ |