Fumadocs

Build better docs, in seconds.

Fumadocs is a React documentation framework for developers, beautifully designed by Fuma Nama.

Get started

Every docs feature is built in.

When your docs need API references, a blog or reader feedback, Fumadocs already supports them.

InternationalizationYour pages in several languages, with a switcher for readers./docs/next/internationalization

Content is code.

Your docs stay accurate as your code changes. They go through your code review, and an example that no longer type-checks fails the build.

lib/slug.ts:5:22 TS2345

#write
slugify.mdx

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.

lib/slug.ts
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'.

Customize every layer.

Change each layer through its options and still get Fumadocs updates, or copy the UI's source with the CLI and edit any line.

UI
layouts and components
Core
page tree, search and i18n
Content
Markdown files or a CMS
#layers
customize
docs

Bring your own stack.

Fumadocs works with the React framework and the CMS or Markdown files you already use, and serves your docs in your readers' languages.

#stack
@fumadocs/cli

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.

openapi.jsonrev 1

AI-native by default.

Coding agents can read and search your docs directly, so their code follows your current API instead of their training data.

Banner

Add a banner to your site

Install to your codebase

Easier customization & control.

npx @fumadocs/cli@latest add banner

Usage

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.
GET /docs/ui/components/banner.md1,702 B

Search finds the exact answer.

Readers answer their own questions instead of asking you. Search works from your first deploy, with no hosted service to pay for.

#details
hide prefix
always
Always hide the prefix, detect locale from cookies
never
Never hide the prefix (default)

Trusted 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.”

shadcnCreator of Shadcn UI

“Major shoutout to @fuma_nama for making fumadocs, a gorgeous documentation framework that composes beautifully into the App Router.”

Anthony ShewTurbo DX at Vercel

“I'd have no shot building @arktypeio docs that looked half this good without it 😍”

David BlassCreator of Arktype

Your docs are one command away.

The files it creates
  • my-app/
    • app/
      • docs/layout.tsxthe docs layout
      • api/search/route.tsthe search API
      • llms.txt/route.tsfor AI agents
    • content/docs/
      • index.mdxyour first page

Hello World

Your first document

Welcome to the docs! You can start writing documents in /content/docs.

What is Next?

+next+fuma-docs-mdx

Learn more about Next.js

Learn more about Fumadocs

fuma-namajunaidanjumkane50613aryasaatvikPANJA-ABHISHEKchenxin-yannktnet1siyamhosankyrylolvovoutsleptturalbabayevsidgaikwadcoderrshyamlord-0011nickvigilanteMichaelErmernainglinnkhantsebdanielssonpjborowieckihyobanstaciaxpombernikhiltidke101chocochuhimself65imliuruiqiAmanVarshney01gronxbremorsesTwinki14joulevxiaoyu2erzaidmukaddamGitstar-OCmehdibhawdonsongshenxianovowjsojnrjdalalnelsonlaidevndom91olabrahmiLioRaeldensumeshyamcodesvitorbarifranky47Axyl1410ariesclarkclaudematerwelonDhruvdimaMachinaLeCartelooalexcarpenterAdamMikacichankrgylanthonyshewsmakoshte6-inmiki-tebemojtabamoosaviMFarabi619Nic13GamerroastlechonofficialrajdeepsinghramonclaudiorubenskjsalemaljebalyYonomSoonIterShikChenShatlyk1011seangray-devMaliksidk19huruihktitofstefanofaFairy-nnSufyrSyntaxHQDEVbytaesuzigang93taqheliasfaltinMokiMeowmrzmyrmkeskinnmnNeko-vecteroscartbeaumontowenwahlgrenPickleNikPieterDePauwPieterT2000hasparusR4ULtvrikublockrishi-raj-jainbuchariteshrobingenzrodrgdstherohanparmargwigzicepengjrizo0kakdukikijvktKongTongllayz46memmmmikexrtisnazo6rez1-devshakedhagagshaked-framesongkeysspookybytesyoutridenticxqe2011yamz8Misyuk-TTinsFoxNICHTJ3garnertbVanshbordiab84330808WillKirkmanMproductdevbookxirothedevyangshunMondayChagangokZain-hareerWh1isperananaszjoeasyncAndChillbenqszbhaveshchow20shczhenchakkyySpyC0der77BurnedChrisdlcastillopDanielPe05mintydev789denizguzelDiegiwgscopsydulapahvdzaky-penaEDALJOEmersonBraunfabianhugtrueberrylessfellipeutakafveiraswwwGermanJabloGioPan04PythonHacker24agusgarcia3007akhil-naiduAlexProgrammerDEaslanmuradovunrevised6419amikofalvyAn-dzneoantoxanuragmitra4arimxyer4rpanSepushasyntaiavner-mAyushSinghal20Bartek532brbrainerdCarlosEduJsdevnjwJiralitejochemvanweeldejohangusejonathanwilkekevin1kidonngyeskunallFarhan291lucperkins12LuALuggaPuggaluke-hagar-spmatejmz4nr34lshenxiangzhuangHardMax71mehrdadrafieeWonderSTKsheen4nGyeonghun-Parksaoudi-hokisdevhaydenhoanghexaaagonjun094kowyoiyansrfeixuedevisboyjcjpage-godaddyjkukulja-andrewsJamiewarbSchutteJanjasontd92EnhancedJaxhuozhi

byFuma Nama

MIT license

fumadocs-core 16.19.9