A search bar with autosuggest, built in React.
npm install react-search-bar --save
View the demo online.
Alternatively, run it locally:
npm install
npm run demo
Then visit localhost:5000.
<SearchBar
onChange={(input, resolve) => {
// get suggestions based on `input`, then pass them to `resolve()`
}} />
You must supply a callback to the onChange
event handler to populate
suggestions. A callback to the onSubmit
event handler is optional.
type: boolean
indicates whether the component should take focus on page load
type: number
the number of milliseconds to wait after the last key stroke before performing autosuggest
type: string
sets the name
attribute on the input field
type: function
callback that executes on input and populates suggestions
type: function
callback that executes on search submit (overrides default form submit)
type: string
sets the placeholder
attribute on the input field
MIT