Root Provider

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

import { RootProvider } from 'fumadocs-ui/provider';

export default function Layout({ children }) {
  return (
    <html lang="en">
      <body>
        <RootProvider>{children}</RootProvider>
      </body>
    </html>
  );
}

Search Dialog

You can customize the search dialog from the root provider.

PropTypeDefault
search
Partial<Omit<SearchProviderProps, "children">>
-
enableThemeProvider
boolean
true
children
ReactNode
-
<RootProvider
  search={{
    links: [
      ['Home', '/'],
      ['Docs', '/docs'],
    ],
  }}
>
  ...
</RootProvider>

Last updated on