# Fumadocs (Framework Mode): Introduction
URL: /docs
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/index.mdx

The documentation framework for React

# Set up Fumadocs

Instructions for AI agents to set up Fumadocs on Next.js. The setup changes between versions, so run the commands below and read the linked docs instead of writing the setup from memory. Add `.md` to the URL of a docs page to read it as Markdown.

Use Next.js unless the user asks for another framework, or their app uses another one. In that case, follow the instructions of that framework instead:

- Next.js: https://fumadocs.dev/docs/next.md
- React Router: https://fumadocs.dev/docs/react-router.md
- TanStack Start: https://fumadocs.dev/docs/tanstack-start.md
- Waku: https://fumadocs.dev/docs/waku.md
- Astro: https://fumadocs.dev/docs/astro.md

## New Site

Create a new docs site in a new folder, or as a workspace package of a monorepo:

```bash
npx create-fumadocs-app@latest my-docs --template +next+fuma-docs-mdx --install --yes
```

For a static site, use the `+next+fuma-docs-mdx+static` template.

- `my-docs` is the folder to create.
- `--yes` skips the prompts, and the options you don't pass use their defaults. The options are listed in https://fumadocs.dev/docs/cli/create-fumadocs-app.md

## Existing App

To add docs to an existing app, run the CLI in the folder of the app:

```bash
npx @fumadocs/cli@latest init
```

- The CLI detects the framework, and adds the docs pages with their own layout beside the existing routes.
- `--i18n` sets up internationalization.
- The CLI asks before it overwrites a file. Without a terminal, it keeps the file and prints its name. Pass `--yes` only when every file it writes can be overwritten.

To set up by hand, or to merge a file that the CLI kept, follow https://fumadocs.dev/docs/next/manual-installation.md

## After the Setup

Both commands print the next steps. Start the dev server and open the docs, at `/docs` unless the output names another path.

For the tasks that follow, read the docs page of the task first:

- Writing pages: https://fumadocs.dev/docs/next/markdown.md
- Organizing pages and folders: https://fumadocs.dev/docs/next/page-conventions.md
- Customizing the UI: https://fumadocs.dev/docs/next/guides/customize-ui.md
- Changing the theme and colors: https://fumadocs.dev/docs/ui/theme.md
- Other tasks: https://fumadocs.dev/llms.txt lists every docs page.

Fumadocs <span className='text-fd-muted-foreground text-sm'>(Foo-ma docs)</span> is a **documentation framework**, designed to be fast, flexible,
and composes seamlessly into your React framework. It consists of multiple layers:

<Cards>
<Card title="Fumadocs Core" href="/docs/headless">
Handles most of the logic, including document search, content source adapters, and Markdown extensions.
</Card>

<Card title="Fumadocs UI" href="/docs/ui">
The default theme of Fumadocs offers a beautiful look for documentation sites and interactive components.
</Card>

<Card title="Content Source">
The source of your content, can be a CMS or local data layers like [Fumadocs MDX](/docs/mdx) (the official content source).
</Card>

<Card title="Fumadocs CLI" href="/docs/cli">
A command line tool to install UI components and automate things, useful for customizing layouts.
</Card>
</Cards>

<Callout title="Want to learn more?">
Read our in-depth [What is Fumadocs](/docs/next/what-is-fumadocs) introduction.
</Callout>

## Choosing a Framework [#choosing-a-framework]

The guides are written for each framework. Choose the one your app uses, or Next.js for a new project:

<Cards>
<Card title="Next.js (Recommended)" href="/docs/next">
Powerful and mature, the default for new projects.
</Card>

<Card title="React Router" href="/docs/react-router">
For React Router apps. Its SPA mode hosts the site statically on a CDN.
</Card>

<Card title="TanStack Start" href="/docs/tanstack-start">
For TanStack Start apps. Its SPA mode hosts the site statically on a CDN.
</Card>

<Card title="Waku" href="/docs/waku">
Fast and simple, a React framework on Vite with server components.
</Card>

<Card title="Astro" href="/docs/astro">
For Astro sites, with content collections and MDX rendered as React islands.
</Card>
</Cards>

<Callout title="Try Fumadocs with simpler DX">
[Fumapress](https://press.fumadocs.dev) is a site generator that manages more features on top of Fumadocs.

- Automatic routing, `llms.txt`, MCP and more basic features.
- Based on Vite ([Waku](https://waku.gg)).

It enforces a React framework of its own, and offers a better DX in return.
</Callout>