Search
Implement document search in your docs
Fumadocs UI provides a good-looking search dialog out-of-the-box.
Open with K ⌘ or K Ctrl.
Search Dialog
You can customize the search dialog from Root Provider.
By default, your dialog will be lazy loaded using
next/dynamic
.
This allows a better initial loading performance.
When not specified, it uses the Built-in Search Client based on Flexsearch.
Algolia
For the setup guide, see Integrate Algolia Search. Make sure you have algoliasearch
installed on your project.
While generally we recommend building your own search with their client-side SDK, you can also plug the built-in dialog interface.
First, create a separate client component for the dialog.
Replace appId
, apiKey
and indexName
with your desired values.
Then, lazy load the dialog with next/dynamic
.
Finally, wrap your entire application under the new Provider
.
The built-in implementation doesn't use instant search (their official javascript client).
Other Solutions
If you want to use other solutions such as ElasticSearch, you can replace the default dialog with your own.
You can lazy load the dialog with next/dynamic
.
Built-in UI
If you want to use the built-in search dialog UI instead of building your own,
you may use the SearchDialog
component.
It is an internal API, might break during iterations
Last updated on