Onedocs

Components

Onedocs includes all the Fumadocs UI components. Use them in your MDX files without importing.

Using components

Pass mdxComponents to your MDX content:

src/app/docs/[[...slug]]/page.tsx
import { DocsPage, mdxComponents } from "onedocs";

// In your page component:
<MDX components={mdxComponents} />

Callout

Highlight important information:

<Callout type="info">
  This is an informational callout.
</Callout>

<Callout type="warn">
  This is a warning callout.
</Callout>

<Callout type="error">
  This is an error callout.
</Callout>

This is an informational callout.

This is a warning callout.

This is an error callout.

Tabs

Organize content into tabs:

<Tabs items={["npm", "yarn", "pnpm", "bun"]}>
  <Tab value="npm">npm install onedocs</Tab>
  <Tab value="yarn">yarn add onedocs</Tab>
  <Tab value="pnpm">pnpm add onedocs</Tab>
  <Tab value="bun">bun add onedocs</Tab>
</Tabs>
npm install onedocs
yarn add onedocs
pnpm add onedocs
bun add onedocs

Cards

Link to other pages:

<Cards>
  <Card title="Getting Started" href="/docs/getting-started">
    Learn how to set up Onedocs
  </Card>
  <Card title="Configuration" href="/docs/configuration">
    Configure your documentation
  </Card>
</Cards>

Steps

Show numbered steps:

<Steps>
  <Step>Install Onedocs</Step>
  <Step>Create configuration</Step>
  <Step>Write documentation</Step>
</Steps>
Install Onedocs
Create configuration
Write documentation

Accordion

Collapsible content:

<Accordions>
  <Accordion title="What is Onedocs?">
    Onedocs is a zero-config documentation wrapper for Next.js and Fumadocs.
  </Accordion>
  <Accordion title="How do I install it?">
    Run `bun add onedocs` to install.
  </Accordion>
</Accordions>

Files

Show file trees:

<Files>
  <Folder name="content" defaultOpen>
    <Folder name="docs" defaultOpen>
      <File name="index.mdx" />
      <File name="getting-started.mdx" />
    </Folder>
  </Folder>
  <File name="onedocs.config.ts" />
</Files>
index.mdx
getting-started.mdx
onedocs.config.ts

More components

Need something else? Import directly from Fumadocs:

import { Callout } from "fumadocs-ui/components/callout";
import { CodeBlock } from "fumadocs-ui/components/codeblock";
import { ImageZoom } from "fumadocs-ui/components/image-zoom";

See the Fumadocs docs for the full list.

On this page