A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/meilisearch/meilisearch-react below:

GitHub - meilisearch/meilisearch-react

⚡ How to integrate a front-end search bar in your React application using Meilisearch

Meilisearch is an open-source search engine. Discover what Meilisearch is!

This repository describes the steps to integrate a relevant front-end search bar with a search-as-you-type experience!

⚡ Supercharge your Meilisearch experience

Say goodbye to server deployment and manual updates with Meilisearch Cloud. Get started with a 14-day free trial! No credit card required.

To integrate a front-end search bar, you need to install two packages:

Run:

yarn add react-instantsearch @meilisearch/instant-meilisearch
# or
npm install react-instantsearch @meilisearch/instant-meilisearch
# or
pnpm add react-instantsearch @meilisearch/instant-meilisearch

NB: If you don't have any Meilisearch instance running and containing your data, you should take a look at this getting started page.

Thanks to the open-source React InstantSearch library, you can add these components to your application:

import React from 'react';
import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch';
import { instantMeiliSearch } from '@meilisearch/instant-meilisearch';

const { searchClient } = instantMeiliSearch(
  'https://ms-adf78ae33284-106.lon.meilisearch.io',
  'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303'
);

const App = () => (
  <InstantSearch
    indexName="steam-video-games"
    searchClient={searchClient}
  >
    <SearchBox />
    <Hits hitComponent={Hit} />
  </InstantSearch>
);

const Hit = ({ hit }) => <Highlight attribute="name" hit={hit} />;

export default App

🚀 For a full getting started example, please take a look at this CodeSandbox:

💡 If you have never used React InstantSearch before, we recommend reading this getting started documentation.

Customization and Documentation

Meilisearch provides and maintains many SDKs and Integration tools like this one. We want to provide everyone with an amazing search experience for any kind of project. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the integration-guides repository.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4