DocSearch packages
DocSearch v5 provides keyword search, AI answers powered by Agent Studio, and lower-level packages for custom integrations.
Start with @docsearch/js for a browser integration or @docsearch/react for a React application. Both packages support the same keyword search options.
Choose a package
| Package | Use it for |
|---|---|
@docsearch/js | JavaScript sites, including sites that don't use React. The default entry includes keyword search and Ask AI. |
@docsearch/react | React applications. Choose DocSearch for keyword search or DocSearchAI for keyword search and Ask AI. |
@docsearch/css | The complete button and modal stylesheet. See Styling. |
@docsearch/core | Shared state, keyboard handling, and the provider for the Composable API. |
@docsearch/modal | Search button, keyword modal, and Ask AI modal components for the Composable API. |
@docsearch/sidepanel | React Sidepanel components for persistent AI conversations. |
@docsearch/sidepanel-js | JavaScript wrapper for the AI Sidepanel. |
If your Docusaurus site uses the DocSearch adapter, follow the Docusaurus adapter guide.
Choose a search experience
Keyword search
Use keyword search when you only need results from Algolia indices. It has no Ask AI runtime.
- JavaScript: import
@docsearch/js/docsearch. - React: render
DocSearchfrom@docsearch/react.
Keyword search and Ask AI
Use the AI-capable integration when you have an Agent Studio assistant.
- JavaScript: use the default
@docsearch/jsexport. - React: render
DocSearchAIfrom@docsearch/react.
Create and configure the assistant before adding it to DocSearch. See Get started with Agent Studio.
Composable and hybrid experiences
Use the Composable API to control the provider, button, and modal separately. Use hybrid mode to combine the modal with the AI Sidepanel.
Beta version
Install the v5 beta with the caret range:
- npm
- Yarn
- pnpm
- Bun
npm install @docsearch/js@^5 @docsearch/css@^5
yarn add @docsearch/js@^5 @docsearch/css@^5
pnpm add @docsearch/js@^5 @docsearch/css@^5
bun add @docsearch/js@^5 @docsearch/css@^5
For an existing v4 integration, read Migrate from v4 and v5 breaking changes.