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.
Setup Tailwind CSS v4 on your Next.js app, add the following to global.css.
Tailwind 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 next/font.
Create a catch-all route /app/docs/[[...slug]] for docs pages.
In the page, wrap your content in the Page component.
It may vary depending on your content source. You should configure static rendering with generateStaticParams and metadata with generateMetadata.
If you want to deploy your Fumadocs app using Docker with Fumadocs MDX configured, make sure to add the source.config.ts file to the WORKDIR in the Dockerfile.
The following snippet is taken from the official Next.js Dockerfile Example:
Dockerfile
WORKDIR /app# Install dependencies based on the preferred package managerCOPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* source.config.ts ./
This ensures Fumadocs MDX can access your configuration file during builds.