1
0
Fork 0
docsearch/packages/docsearch-js
Pierre Millot e52c8f3435
chore: release v3.6.3 (#2330)
* chore: release v3.6.3

* fix website
2024-10-31 17:16:34 +01:00
..
src chore(deps): update lint dependency (#1120) 2021-11-02 12:06:22 +01:00
babel.config.js chore: ignore no-commonjs lint rule for config files 2020-11-12 17:32:52 +01:00
package.json chore: release v3.6.3 (#2330) 2024-10-31 17:16:34 +01:00
README.md fix: upgrade algoliasearch to v5 (#2326) 2024-10-30 15:46:38 +01:00
rollup.config.js fix #2230 - prevent babel helpers duplication and condense bundle & types (#2278) 2024-07-16 10:58:22 -06:00
tsconfig.declaration.json chore: update TypeScript 2020-11-25 11:37:58 +01:00

@docsearch/js

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

Installation

yarn add @docsearch/js@3
# or
npm install @docsearch/js@3

Get started

If you dont want to use a package manager, you can use a standalone endpoint:

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

To get started, you need a container for your DocSearch component to go in. If you dont have one already, you can insert one into your markup:

<div id="docsearch"></div>

Then, insert DocSearch into it by calling the docsearch function and providing the container. It can be a CSS selector or an Element.

Make sure to provide a container (for example, a div), not an input. DocSearch generates a fully accessible search box for you.

import docsearch from '@docsearch/js';

import '@docsearch/css';

docsearch({
  container: '#docsearch',
  appId: 'YOUR_APP_ID',
  indexName: 'YOUR_INDEX_NAME',
  apiKey: 'YOUR_SEARCH_API_KEY',
});

Documentation

Read documentation →