Fumadocs
Build better docs, in seconds.
Fumadocs is a React documentation framework. Your Markdown becomes a full docs site with navigation, search and a beautiful UI, on the React framework you already use.
Runs on
pnpm create fumadocs-app
Search finds the exact answer.
A matching row of a table comes back as the row itself, so readers often get their answer without opening the page.
alwaysneverContent is code.
Pages are MDX files next to your code, and Twoslash checks your examples against your types. A mistake stops the deploy instead of reaching readers.
lib/slug.ts:5:22 TS2345
Usage
Pass any title, and the slug comes back in lowercase with dashes between its words.
Stable links
The same title always gives the same slug.
export function slugify(title: string) { return title.toLowerCase().replaceAll(' ', '-'); } const slug = slugify(42);TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
Your API docs stay in sync.
Reference pages are built from your schemas and types on every deploy, so they always match the code you ship.
AI-native by default.
Every page is also served as Markdown, listed in llms.txt and searchable over MCP, so coding agents read your docs instead of guessing.
Banner
Add a banner to your site
Install to your codebase
Easier customization & control.
npx @fumadocs/cli@latest add bannerUsage
Put the element at the top of your root layout, you can use it for displaying announcements.
import { Banner } from 'fumadocs-ui/components/banner';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<Banner>Hello World</Banner>
{children}
</body>
</html>
);
}Variant
Change the default variant.
import { Banner } from 'fumadocs-ui/components/banner';
<Banner variant="rainbow">Hello World</Banner>;
// customize colors
<Banner
variant="rainbow"
rainbowColors={[
'rgba(255,100,0, 0.5)',
'rgba(255,100,0, 0.5)',
'transparent',
'rgba(255,100,0, 0.5)',
'transparent',
'rgba(255,100,0, 0.5)',
'transparent',
]}
>
Hello World
</Banner>;Change Layout
By default, the banner uses a style tag to modify Fumadocs layouts (e.g. reduce the sidebar height).
You can disable it with:
import { Banner } from 'fumadocs-ui/components/banner';
<Banner changeLayout={false}>Hello World</Banner>;Close
To allow users to close the banner, give the banner an ID.
import { Banner } from 'fumadocs-ui/components/banner';
<Banner id="hello-world">Hello World</Banner>;The state will be automatically persisted.
# Fumadocs UI (the default theme of Fumadocs): Banner
URL: /docs/ui/components/banner
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/ui/components/banner.mdx
Add a banner to your site
Install to your codebase:
```bash
npx @fumadocs/cli@latest add banner
```
## Usage [#usage]
Put the element at the top of your root layout, you can use it for displaying announcements.
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{/* [!code ++] */}
<Banner>Hello World</Banner>
{children}
</body>
</html>
);
}
```
### Variant [#variant]
Change the default variant.
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner variant="rainbow">Hello World</Banner>;
// customize colors
<Banner
variant="rainbow"
rainbowColors={[
'rgba(255,100,0, 0.5)',
'rgba(255,100,0, 0.5)',
'transparent',
'rgba(255,100,0, 0.5)',
'transparent',
'rgba(255,100,0, 0.5)',
'transparent',
]}
>
Hello World
</Banner>;
```
### Change Layout [#change-layout]
By default, the banner uses a `style` tag to modify Fumadocs layouts (e.g. reduce the sidebar height).
You can disable it with:
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner changeLayout={false}>Hello World</Banner>;
```
### Close [#close]
To allow users to close the banner, give the banner an ID.
```tsx
import { Banner } from 'fumadocs-ui/components/banner';
<Banner id="hello-world">Hello World</Banner>;
```
The state will be automatically persisted.Customize every layer.
Content, core and UI are separate layers. Configure one and keep updating, or copy its code with the CLI and change anything.
npx @fumadocs/cli customize
Every docs feature is built in.
No plugins to hunt for. Each feature ships with Fumadocs in the same design, and updates with it.
InternationalizationPages in every language, the UI's text in 3 more./docs/next/internationalization
Bring your own stack.
Keep your React framework and your content source, and give readers the UI in their language.
npx @fumadocs/cli initTrusted by teams in production.
UI libraries, auth frameworks, databases and validators publish their docs with Fumadocs.
“You know how you end up rebuilding a full docs site every time you start a new project? Fumadocs fixes this by giving you all the right blocks that you compose together. Like headless docs to build exactly what you need.”
“Major shoutout to @fuma_nama for making fumadocs, a gorgeous documentation framework that composes beautifully into the App Router.”
“I'd have no shot building @arktypeio docs that looked half this good without it 😍”
Your docs are one command away.
pnpm create fumadocs-app
Hello World
Your first document
Welcome to the docs! You can start writing documents in /content/docs.
console.log('Hello World');What's next?
Learn more about Next.js
Learn more about Fumadocs
byFuma Nama
MIT license
fumadocs-core 16.19.8




