Manual Installation
Add Fumadocs to an existing Waku project.
You can also let Fumadocs CLI set it up for you:
npx @fumadocs/cli initPrerequisites
Before continuing, make sure you have configured:
- Tailwind CSS 4.
- Fumadocs MDX: follow the Vite setup guide and create essential files like
lib/source.ts.
Good to Know
Fumadocs also supports other content sources, including Content Collections and headless CMS.
Getting Started
Install the packages:
npm i fumadocs-core fumadocs-uiStyles
Add the following to your Tailwind CSS file:
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';Root Provider
Wrap your entire app inside Root Provider from a client component:
'use client';
import type { ReactNode } from 'react';
import { RootProvider } from 'fumadocs-ui/provider/waku';
export function Provider({ children }: { children: ReactNode }) {
return <RootProvider>{children}</RootProvider>;
}
Routes
Put the shared options of your layouts in one file:
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import { appName, gitConfig } from './shared';
export function baseOptions(): BaseLayoutProps {
return {
nav: {
// JSX supported
title: appName,
},
githubUrl: `https://github.com/${gitConfig.user}/${gitConfig.repo}`,
};
}
Create the following files:
import defaultMdxComponents from 'fumadocs-ui/mdx';
import type { MDXComponents } from 'mdx/types';
export function getMDXComponents(components?: MDXComponents) {
return {
...defaultMdxComponents,
...components,
} satisfies MDXComponents;
}
export const useMDXComponents = getMDXComponents;
declare global {
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
}
The search route uses ZBSearch. See Document Search to configure it.
Finish
Start the dev server and write your docs in content/docs:
---
title: Hello World
---
## Introduction
I love Fumadocs.How is this guide?
Last updated on
