Skip to main content
DocSearch provides extensive customization options to tailor the search experience to your documentation site’s needs.

Placeholder Text

Customize the search input placeholder text to guide users:
The placeholder text automatically adapts when Ask AI features are enabled:
  • Default: Uses your custom placeholder prop or “Search docs”
  • Ask AI enabled: Changes to “Search docs or ask AI a question”
  • In Ask AI mode: Shows “Ask another question…”

Transform Items

The transformItems function allows you to modify search results before they’re displayed. This is useful for filtering, sorting, or enhancing results.

Common Use Cases

Maximum Results Per Group

Control how many results are displayed per section:
The default value is determined by the Algolia search configuration. Setting this value will override the default behavior.

Custom Hit Component

Customize how individual search results are rendered:

Using HTML Template Syntax

You can also use HTML template strings:
Add custom content at the bottom of search results:

Search Parameters

Pass additional Algolia search parameters to customize the search behavior:
The indices property replaces the deprecated indexName and searchParameters props, allowing you to search multiple indices with different configurations.

Multiple Indices

Search across multiple documentation indices:

Transform Search Client

Modify the Algolia search client before it’s used:

Initial Query

Pre-fill the search input with an initial query:

Custom Navigator

Control navigation behavior when users select search results:

Missing Results URL

Provide a feedback mechanism for queries with no results:
When users search for something with no results, they’ll see a link to report the missing content.

Portal Container

Specify where the search modal should be rendered in the DOM:
By default, the modal is rendered into document.body.