npm.io
5.1.2 • Published 2 weeks ago

@docsearch/react

Licence
MIT
Version
5.1.2
Deps
9
Size
4.0 MB
Vulns
0
Weekly
0
Stars
4.4K

@docsearch/react

React package for DocSearch, the best search experience for docs.

Installation

npm install @docsearch/react@5

If you don’t want to use a package manager, you can use a standalone endpoint:

<script src="https://cdn.jsdelivr.net/npm/@docsearch/react@5"></script>

Get started

DocSearch generates a fully accessible search box for you.

import { DocSearch } from '@docsearch/react';

import '@docsearch/css';

function App() {
  return (
    <DocSearch
      appId="YOUR_APP_ID"
      indices={['YOUR_INDEX_NAME']}
      apiKey="YOUR_SEARCH_API_KEY"
    />
  );
}

export default App;

Documentation

Lazy-load the Sidepanel with a static SidepanelButton import from @docsearch/react/sidepanelButton and a dynamic panel import from @docsearch/react/sidepanelPanel.

Read documentation →