prmbr-image-mksaas/content/docs/layouts/root-provider.mdx
javayhu 16aaf55a91 refactor: enhance documentation feature and update dependencies
- Updated content collections to include new schemas for better document handling.
- Added new documentation files for comparisons, customization, and internationalization.
- Introduced a manual installation guide and improved markdown support.
- Updated package.json with new dependencies for enhanced functionality.
- Added new images for documentation and improved layout components for better user experience.
- Adjusted TypeScript configurations for better path management.
2025-03-30 22:34:16 +08:00

55 lines
945 B
Plaintext

---
title: Root Provider
description: The context provider of Fumadocs UI.
---
The context provider of all the components, including `next-themes` and context
for search dialog. It should be located at the root layout.
## Usage
```jsx
import { RootProvider } from 'fumadocs-ui/provider';
export default function Layout({ children }) {
return (
<html lang="en">
<body>
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
```
### Search Dialog
Customize or disable the search dialog with `search` option.
```jsx
<RootProvider
search={{
enabled: false,
}}
>
{children}
</RootProvider>
```
Learn more from [Search](/docs/search).
### Theme Provider
Fumadocs supports light/dark modes with [`next-themes`](https://github.com/pacocoursey/next-themes).
Customise or disable it with `theme` option.
```jsx
<RootProvider
theme={{
enabled: false,
}}
>
{children}
</RootProvider>
```