---
title: Doc Blocks for Astro
description: "Astro reference-page layouts with contents links and previous/next navigation."
seo:
    title: "Astro Doc blocks: examples and source"
sidebar:
    label: "Doc"
related:
    - /components/toc
    - /blocks/article
    - /components/section
    - /components/alert
mode: wide
---

## Guide

Use a reading column with contents links, a callout, and previous and next navigation.

```astro
---
import Doc1Block from "@/components/blocks/doc/doc-1.astro"
---

<Doc1Block
  title="Prepare a weekly project review"
  description="A sample guide for a fictional planning service, with local contents links and reading navigation."
  tocItems={[
    { depth: 2, href: "#installation", label: "Prepare the review" },
    { depth: 2, href: "#anatomy", label: "Discuss open questions" },
    {
      depth: 3,
      href: "#empty-state",
      label: "When the question list is empty",
    },
    { depth: 2, href: "#usage", label: "Agree on next actions" },
  ]}
  callout={{
    description:
      "Bring unresolved questions to the review and record who will check each one.",
    button: {
      label: "Read the planning guide",
      href: "/components/command",
      variant: "outline",
    },
  }}
  previousPage={{
    href: "/components/combobox",
    title: "Combobox",
  }}
  nextPage={{
    href: "/components/dialog",
    title: "Dialog",
  }}
  labels={{
    copyMarkdown: "Copy Markdown",
    openIn: "Open in",
    openInMarkdown: "Markdown",
    openInChatGPT: "ChatGPT",
    openInClaude: "Claude",
    openInCursor: "Cursor",
    pagination: {
      previous: "Previous",
      next: "Next",
      ariaLabel: "Docs pagination",
    },
    toc: "On this page",
  }}
>
  <h2 id="installation">Prepare the review</h2>
  <p>
    Gather the current project brief, the open task list, and the notes from
    your previous review. Check that each document describes the same milestone
    before you invite the team.
  </p>
  <h2 id="anatomy">Discuss open questions</h2>
  <p>
    Start the discussion with questions that prevent progress. Decide which
    questions can be answered now and assign the remaining checks to a named
    person. Record the reason for each decision.
  </p>
  <h3 id="empty-state">When the question list is empty</h3>
  <p>
    When there are no open questions, use the time to check unfinished tasks.
    Confirm whether each task still belongs in the current milestone rather than
    adding work to fill the meeting.
  </p>
  <h2 id="usage">Agree on next actions</h2>
  <p>
    Close the review with a short list of actions. Give each action an owner, a
    next step, and a date for the next check. Share the notes with anyone who
    could not attend.
  </p>
</Doc1Block>
```

```sh
bunx --bun shadcn@latest add @gnostic/doc-1
```

## Choose a doc layout

Choose a doc layout for material that readers will scan and revisit. Keep the title specific and organize the body into stable headings that can be linked directly.

## Pass content from Astro

Pass the title, description, table-of-contents items, labels, and navigation links required by the variant. The copy button reads the current page path and copies the text from that path with a `.md` extension. The block does not discover collections, create routes, or infer heading IDs.

## Responsive layout and images

Check the contents list when the layout becomes one column. Wide code and tables need their own overflow handling. Images in the body need dimensions and descriptive alt text; avoid using screenshots as the only source of instructions.
