Integrate a search-as-you-type experience into your React app.
react-instantsearch
, @meilisearch/instant-meilisearch
, and instantsearch.css
.
<InstantSearch>
is the root provider component for the InstantSearch library. It takes two props: the searchClient
and the index name.
SearchBox
and InfiniteHits
components inside the InstantSearch
wrapper component. The Hits component accepts a custom Hit component via the hitComponent
prop, which allows customizing how each search result is rendered.
Import the CSS library to style the search components.
.ais-InstantSearch
, .ais-SearchBox
, .ais-InfiniteHits-list
, .ais-InfiniteHits-item
localhost:3000
), and start searching.