Search Component
A built-in search component provides a seamless and fast search experience out of the box. Under the hood, it leverages the Pagefind package — a fully client-side search engine optimized for static sites. Pagefind indexes your content at build time and enables highly performant, zero-JavaScript-dependency searches at runtime.
Exported from nextra/components.
Props
| Name | Type | Default | 
|---|---|---|
className | stringInput container CSS class name.  | |
placeholder | stringPlaceholder text.  | 'Search documentation…' | 
emptyResult | ReactNodeNot found text.  | 'No results found.' | 
errorText | ReactNodeError text.  | 'Failed to load search index.' | 
loading | ReactNodeLoading text.  | 'Loading…' | 
searchOptions | PagefindSearchOptions | |
onSearch | (query: string) => voidCallback function that triggers whenever the search input changes. This prop is not serializable and cannot be used directly in a server-side layout. To use this prop, wrap the component in a client-side wrapper. Example: search-with-callback.jsx Then pass the wrapper to the layout: app/layout.jsx  | |
...props | Omit<ComboboxInputProps, "className" | "onChange" | "placeholder" | "value" | "onFocus" | "onBlur"> |