2.2.2 • Published 6 years ago

react-search-bar-allreact v2.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

A general-purpose search bar, built in React. View the demo.

Development

To run the dev server:

npm start

To run tests and lint:

npm run check

Props

PropTypeRequiredDescription
autoFocusbooleanIf true, focuses the input when the component loads
delaynumberThe number of milliseconds to wait after the last key stroke before calling onChange
onChangefunctionCalled when input changes
onClearfunctionCalled when suggestions are cleared
onSearchfunction1Called when clicking the search button or enter (presumes that search button is available)
onSelectionfunctionCalled when selecting a suggestion
renderClearButtonbooleanFlag indicating whether to display the clear button
renderSearchButtonbooleanFlag indicating whether to display the search button
styleobjectStyle object
suggestionRendererfunctionFunction to render suggestions
suggestionsarray\Array of suggestions

Also accepts supported HTML attributes for the <input> element.

1 Only when renderSearchButton is true

License

MIT