Make sure to configure the library correctly following their setup guide before continuing, we will import the source adapter using
@/lib/source.ts
in this guide.
Root Layout
Wrap the entire application inside Root Provider, and add required styles to
body
.
import { RootProvider } from 'fumadocs-ui/provider';import type { ReactNode } from 'react';export default function Layout({ children }: { children: ReactNode }) { return ( <html lang="en" suppressHydrationWarning> <body // you can use Tailwind CSS too style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh', }} > <RootProvider>{children}</RootProvider> </body> </html> );}
Styles
Setup Tailwind CSS v4 on your Next.js app, add the following to
global.css
.
@import 'tailwindcss';@import 'fumadocs-ui/css/neutral.css';@import 'fumadocs-ui/css/preset.css';/* path of `fumadocs-ui` relative to the CSS file */@source '../node_modules/fumadocs-ui/dist/**/*.js';
It doesn't come with a default font, you may choose one from