Search dialog
Search your docs from a dialog opened with a keyboard shortcut.
Installation
Usage
RootProvider opens the default search dialog with ⌘ K (Ctrl K on Windows and Linux), or from the search triggers in the layouts. It queries /api/search, which you create with Fumadocs Core's search server:
Results show pages, headings and text with the matches highlighted. Use the arrow keys and Enter to open one, and Esc to close the dialog.
Options
Pass options to the default dialog through RootProvider:
| Option | Type | Description |
|---|---|---|
api | string | The search API URL. Defaults to /api/search. |
delayMs | number | Debounce delay before searching. |
tags | TagItem[] | Tag filters shown below the results. |
defaultTag | string | The tag selected at first. |
allowClear | boolean | Allow deselecting the tag. |
footer | ReactNode | Extra content at the bottom of the dialog. |
links | [name, href][] | Links shown before the reader types a query. |
Build your own dialog
The search-dialog component exports the parts the default dialog is made of, for other search clients:
Pass it to RootProvider as search={{ SearchDialog: CustomSearchDialog }}. The dialog is built on Base UI's Dialog, the primitive under shadcn/ui's dialog, with shadcn/ui kbd.