# Fumadocs (Framework Mode, TanStack Start): Quick Start
URL: /docs/tanstack-start
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/index.mdx

Getting Started with Fumadocs

# Set up Fumadocs

Instructions for AI agents to set up Fumadocs on TanStack Start. 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.

## 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 tanstack-start --install --yes
```

For a static site, use the `tanstack-start-spa` 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/tanstack-start/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/tanstack-start/markdown.md
- Organizing pages and folders: https://fumadocs.dev/docs/tanstack-start/page-conventions.md
- Customizing the UI: https://fumadocs.dev/docs/tanstack-start/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.

## Terminology [#terminology]

**Markdown/MDX:** Markdown is a markup language for creating formatted text. Fumadocs natively supports Markdown and MDX (superset of Markdown).

**[Bun](https://bun.sh):** A JavaScript runtime, it will be used in our guides for running scripts. If you prefer Node.js, try [unrun](https://gugustinette.github.io/unrun/guide/getting-started.html#cli) instead.

Some basic knowledge of React.js would be useful for further customizations.

## Automatic Installation [#automatic-installation]

A minimum version of Node.js 22 required.

```npm
npm create fumadocs-app
```

It will ask you the built-in template to use:

- **Framework**: Next.js, React Router, TanStack Start, Waku and Astro.
- **Content source**: Fumadocs MDX, or Astro content collections.

A new fumadocs app should be initialized, with following features configured by default:

- [LLM integration](/docs/tanstack-start/integrations/llms).
- [Dynamic metadata image](/docs/tanstack-start/integrations/og).

<Callout title="From Existing Codebase?">
You can follow the [Manual Installation](/docs/tanstack-start/manual-installation) guide to get started.
</Callout>

### Enjoy! [#enjoy]

Create your first MDX file in the docs folder.

```mdx title="content/docs/index.mdx"
---
title: Hello World
---

## Yo what's up
```

Run the app in development mode:

```npm
npm run dev
```

Open http://localhost:3000/docs to see your page.

## FAQ [#faq]

Some common questions you may encounter.

<Accordions>
<Accordion id="upgrade-fumadocs" title="Getting error with missing APIs or bugs?">
The API or the fix may be in a newer version. [Upgrade Fumadocs](/docs/tanstack-start/upgrade) and try again.
</Accordion>

<Accordion id="change-base-url" title="How to change the base route of docs?">
Routing is handled by TanStack Start. Move the docs route first (`/docs/*` -> `/info/*`).

Move `src/routes/docs/$.tsx` to `src/routes/info/$.tsx`.

Finally, update the base URL of pages in `source.ts`:

```ts title="lib/source.ts"
import { loader } from 'fumadocs-core/source';

export const source = loader({
  baseUrl: '/info', // to the new value [!code highlight]
});
```

The templates define this value as `docsRoute` in `lib/shared.ts`, change it there so Markdown links follow.
</Accordion>

<Accordion id="multi-docs" title="How to implement multi-docs?">
We recommend using [Layout Tabs](/docs/ui/layouts/docs#layout-tabs).
</Accordion>

<Accordion id="vite-context-error" title="Getting error with React contexts?">
There's some weird pre-bundling problems with Vite: [#3910](https://github.com/vitejs/vite/issues/3910).
Make sure to exclude Fumadocs from pre-bundling and add it to `noExternal`:

```ts title="vite.config.ts"
import { defineConfig } from 'vite';

export default defineConfig({
  resolve: {
    // add other Fumadocs deps as needed
    noExternal: ['fumadocs-core', 'fumadocs-ui', 'fumadocs-openapi', '@fumadocs/base-ui'],
  },
});
```
</Accordion>
</Accordions>

## Learn More [#learn-more]

New to here? Don't worry, we are welcome for your questions.

If you find anything confusing, please give your feedback on [Github Discussion](https://github.com/fuma-nama/fumadocs/discussions)!

### Writing Content [#writing-content]

For authoring docs, make sure to read:

<Cards>
<Card href="/docs/markdown" title="Markdown">
/docs/tanstack-start/markdown" title="Markdown">
  Fumadocs has some additional features for authoring content.
</Card>

<Card href="/docs/navigation" title="Navigation">
/docs/tanstack-start/navigation" title="Navigation">
  Learn how to customize navigation structure.
</Card>

<Card href="/docs/page-conventions" title="Page Slugs & Page Tree">
/docs/tanstack-start/page-conventions" title="Page Slugs & Page Tree">
  Learn how to organise content.
</Card>

<Card href="/docs/ui/components" title="Components" description="See all available components to enhance your docs" />
</Cards>

### Special Needs [#special-needs]

<Cards>
<Card href="/docs/deploying/static" title="Configure Static Export" description="Learn how to enable static export on your docs">
/docs/tanstack-start/deploying/static
</Card>

<Card href="/docs/internationalization" title="Internationalization" description="Learn how to enable i18n">
/docs/tanstack-start/internationalization
</Card>

<Card href="/docs/ui/theme" title="Color Themes" description="Add themes to Fumadocs UI" />

<Card href="/docs/ui/layouts" title="Layouts" description="Customize your Fumadocs UI layouts" />
</Cards>