---
title: "DocsPage"
description: "A docs page with a table of contents, breadcrumb and previous/next links."
url: https://docscn.dev/docs/components/docs-page
lastModified: 2026-10-08T08:01:44.000Z
---

# DocsPage (/docs/components/docs-page)

> A docs page with a table of contents, breadcrumb and previous/next links.

## Installation [#installation]

```npm
npx shadcn@latest add @docscn/docs-page
```

## Usage [#usage]

```tsx title="app/docs/[[...slug]]/page.tsx"
import { notFound } from "next/navigation";
import { getMDXComponents } from "@/components/mdx";
import {
  DocsBody,
  DocsDescription,
  DocsPage,
  DocsTitle,
} from "@/components/docs/layouts/docs/page";
import { createRelativeLink } from "@/components/docs/mdx";
import { source } from "@/lib/source";

export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
  const params = await props.params;
  const page = source.getPage(params.slug);
  if (!page) notFound();

  const MDX = page.data.body;

  return (
    <DocsPage toc={page.data.toc} full={page.data.full}>
      <DocsTitle>{page.data.title}</DocsTitle>
      <DocsDescription>{page.data.description}</DocsDescription>
      <DocsBody>
        <MDX
          components={getMDXComponents({ a: createRelativeLink(source, page) })}
        />
      </DocsBody>
    </DocsPage>
  );
}
```

Use it inside [`DocsLayout`](/docs/components/docs-layout). `DocsBody` adds the [`docs-typeset`](/docs/theming#typography) class.

## Props [#props]

<TypeTable
  type={{
    toc: {
      description: (
        <>
          The page's headings, usually <code>{"page.data.toc"}</code>.
        </>
      ),
      type: "TOCItemType[]",
    },
    full: {
      description: <>Use the full width and hide the desktop TOC.</>,
      type: "boolean",
    },
    tableOfContent: {
      description: (
        <>
          The TOC beside the page on wide screens. <code>{"single: true"}</code>{" "}
          highlights one heading at a time, and <code>{"style"}</code> picks one
          of the <a href="/docs/components/toc#styles">TOC styles</a>.
        </>
      ),
      type: "{ enabled?, single?, style?, header?, footer?, container?, list? }",
    },
    tableOfContentPopover: {
      description: (
        <>
          The TOC popover at the top of the page on smaller screens, with the
          same <code>{"style"}</code> option.
        </>
      ),
      type: "{ enabled?, style?, header?, footer?, ... }",
    },
    breadcrumb: {
      description: (
        <>
          The breadcrumb above the page, on shadcn/ui{" "}
          <code>{"breadcrumb"}</code>.
        </>
      ),
      type: "{ enabled?, includeRoot?, includePage?, includeSeparator? }",
    },
    footer: {
      description: (
        <>
          Previous and next page links, taken from the page tree unless you pass{" "}
          <code>{"items"}</code>.
        </>
      ),
      type: "{ enabled?, items? }",
    },
  }}
/>

The rest are passed to the page's `<article>`.

## Other exports [#other-exports]

- `EditOnGitHub`: a link button, e.g. `<EditOnGitHub href="https://github.com/…/edit/main/content/docs/index.mdx" />`.
- `PageLastUpdate`: shows `Last updated on <date>` in the reader's locale, from a `date` prop.
- `PageBreadcrumb` and `PageFooter`: the breadcrumb and footer on their own.
- `MarkdownCopyButton` and `ViewOptionsPopover`: the [page actions](/docs/components/page-actions).
- `useDocsPage()`: returns `{ full }`.