DocSearchProps interface. Pass these options to the DocSearch component to customize its behavior.
Required Options
string
required
Algolia application ID used by the search client.
string
required
Public API key with search permissions for the index.
string
deprecated
Name of the Algolia index to query.Deprecated: Use
indices property instead. This will be removed in a future version.Array<DocSearchIndex | string>
List of indices and optional search parameters to be used for search. Each item can be:
- A string (index name)
- A
DocSearchIndexobject withnameand optionalsearchParameters
DocSearchIndex Interface
DocSearchIndex Interface
Ask AI Configuration
DocSearchAskAi | string
Configuration to enable Ask AI mode. Pass a string assistant ID or a full config object.
DocSearchAskAi Interface
DocSearchAskAi Interface
(initialMessage: InitialAskAiMessage) => boolean | void
Intercept Ask AI requests (e.g., submitting a prompt or selecting a suggested question).Return
true to prevent the default modal Ask AI flow (no toggle, no sendMessage). Useful to route Ask AI into a different UI (e.g., sidepanel) without flicker.Search Customization
string
Placeholder text for the search input.
SearchParamsObject
deprecated
Additional Algolia search parameters to merge into each query.Deprecated: Use
indices property instead. This will be removed in a future version.number
Maximum number of hits to display per source/group.
(items: DocSearchHit[]) => DocSearchHit[]
Hook to post-process hits before rendering. Useful for filtering, sorting, or modifying search results.
(searchClient: DocSearchTransformClient) => DocSearchTransformClient
Hook to wrap or modify the Algolia search client. Useful for adding custom headers, logging, or modifying requests.
Custom Components
(props, helpers?) => JSX.Element
Custom component to render an individual hit. Supports multiple template patterns:
- HTML strings with html helper:
(props, { html }) => html\…“ - JSX templates:
(props) => <div>...</div> - Function-based templates
Custom component rendered at the bottom of the results panel. Supports the same template patterns as
hitComponent.User Personalization
boolean
default:false
Disable storage and usage of recent and favorite searches.
number
default:7
Limit of how many recent searches should be saved and displayed.
number
default:4
Limit of how many recent searches should be saved and displayed when there are favorited searches.
Navigation & Behavior
string
Query string to prefill when opening the modal.
Custom navigator for controlling link navigation. Useful for integrating with client-side routers.
({ query }: { query: string }) => string
Builds a URL to report missing results for a given query.
DocSearchModalShortcuts
Configuration for keyboard shortcuts. Allows enabling/disabling specific shortcuts.
Theming & Display
DocSearchTheme
Theme overrides applied to the modal and related components. Accepts
'dark' or 'light'.See Theme Options for more details.DocSearchTranslations
Localized strings for the button and modal UI.See Translations for all available translation strings.
DocumentFragment | Element
The container element where the modal should be portaled to. Defaults to
document.body.Analytics
AutocompleteOptions['insights']
Insights client integration options to send analytics events.
