根提供者
Fumadocs 界面的上下文提供者。
所有组件的上下文提供者,包括 next-themes 和 <FrameworkProvider />。它应该位于根布局中。
🌐 The context provider of all the components, including next-themes and <FrameworkProvider />. It should be located at the root layout.
使用
🌐 Usage
根据你的 React.js 框架导入它:
🌐 Import it according to your React.js framework:
import { RootProvider } from 'fumadocs-ui/provider/next';
export default function Layout({ children }) {
return (
<html lang="en">
<body>
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}搜索对话框
🌐 Search Dialog
使用 search 选项自定义或禁用搜索对话框。
🌐 Customize or disable the search dialog with search option.
<RootProvider
search={{
enabled: false,
}}
>
{children}
</RootProvider>从 搜索 了解更多。
🌐 Learn more from Search.
主题提供者
🌐 Theme Provider
Fumadocs 支持使用 next-themes 的亮色/暗色模式。可以通过 theme 选项进行自定义或禁用。
🌐 Fumadocs supports light/dark modes with next-themes.
Customise or disable it with theme option.
<RootProvider
theme={{
enabled: false,
}}
>
{children}
</RootProvider>你也可以在代码中安装并引用 next-themes 来管理主题。
🌐 You can also install & reference next-themes in your code for managing themes.
Last updated on
