Root Provider

The context provider of Next Docs 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 'next-docs-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
SearchDialog
React.FC<SearchDialogProps>
-
links
[string, string][]
-
<RootProvider
  search={{
    links: [
      ['Home', '/'],
      ['Docs', '/docs']
    ]
  }}
>
  ...
</RootProvider>

Last updated on