react-seda-search
v1.0.10
Published
react-seda-search React component
Downloads
254
Readme
React SEDA Search Component
React component for searching schools, districts, counties, and cities
Usage
Pass the Algolia configuration to the component, along with the indicies to search and an event handler to handle when an option is selected.
<SedaSearch
algoliaId='{ALGOLIA_ID}'
algoliaKey='{ALGOLIA_KEY}'
onSuggestionSelected={console.log}
indices={['cities', 'counties', 'districts', 'schools']}
inputProps={{
placeholder: 'Search seda data..'
}}
/>
Props
The following props can be passed to the search component:
- algoliaId
string
required ID for the algolia project - algoliaKey:
string
API key for Algolia - indicies:
array
list of indicies to search (cities, counties, districts, and/or schools) - inputProps:
object
properties to be passed to the input field - onSuggestionSelected:
func
function to handle selected search suggestion