> ## Documentation Index
> Fetch the complete documentation index at: https://learn.mintlify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cards as navigation

> Use cards to guide readers to their next step.

export const Quiz = ({question, answers, correctFeedback, incorrectFeedback}) => {
  const [selected, setSelected] = React.useState(null);
  const [checked, setChecked] = React.useState(false);
  const quizId = React.useId();
  const isCorrect = checked && answers[selected]?.correct;
  const reset = () => {
    setSelected(null);
    setChecked(false);
  };
  return <div className={"quiz-container" + (checked ? " quiz-checked" : "")}>
      <Badge color="green">Quiz</Badge>
      <p className="quiz-question" id={quizId + "-question"}>{question}</p>
      <div className="quiz-options" role="radiogroup" aria-labelledby={quizId + "-question"} aria-disabled={checked}>
        {answers.map((answer, i) => <label key={i} className={["quiz-option", !checked && selected === i ? "quiz-option-selected" : "", checked && answer.correct ? "quiz-option-correct" : "", checked && selected === i && !answer.correct ? "quiz-option-incorrect" : ""].filter(Boolean).join(" ")}>
            <input type="radio" name={"quiz-" + quizId} checked={selected === i} onChange={() => !checked && setSelected(i)} disabled={checked} />
            <span className="quiz-radio" />
            <span className="quiz-option-label">{answer.text}</span>
          </label>)}
      </div>
      {checked && <div className={"quiz-feedback " + (isCorrect ? "quiz-feedback-correct" : "quiz-feedback-incorrect")} role="status" aria-live="polite" aria-atomic="true">
          <span className="quiz-feedback-icon">{isCorrect ? "✓" : "✗"}</span>
          {isCorrect ? correctFeedback : incorrectFeedback}
        </div>}
      <div className="quiz-actions">
        {!checked ? <button className="quiz-btn quiz-btn-check" type="button" onClick={() => selected !== null && setChecked(true)} disabled={selected === null}>
            Check answer
          </button> : <button className="quiz-btn quiz-btn-reset" type="button" onClick={reset}>
            Try again
          </button>}
      </div>
    </div>;
};

A card with a link is a navigation element. It tells readers where to go next or what closely relates to what they just read. A card without a link is just a visual container. Sometimes useful for grouping, but easy to overuse.

Before adding a card, ask whether you want the reader to go somewhere. If yes, cards are the right tool. If you're adding them because they look good, a list or plain text could do the same job with less visual noise. You can still use cards for decoration, but make sure it is intentional and helps users understand your content.

## Where do cards belong?

Cards work best at the boundaries of content. The beginning or end of a page, an overview that points to child pages, or a section that exits into a different part of the docs.

At the end of a guide, cards make the next step explicit and clickable:

```mdx End of a guide theme={null}
You've connected your repository. Next, configure how your site deploys.

<Card title="Configure deployments" href="/guides/configure-deployments" icon="settings">
  Set your build command, output directory, and environment variables.
</Card>
```

On overview pages, a columns grid of cards gives readers a visual menu of what's inside:

```mdx Overview page theme={null}
<Columns cols={2}>
  <Card title="Quickstart" href="/quickstart" icon="rocket">
    Get your first page live.
  </Card>
  <Card title="Connect GitHub" href="/guides/github" icon="github">
    Link your documentation to a GitHub repository.
  </Card>
  <Card title="Customize your theme" href="/customize/theme" icon="paintbrush">
    Colors, fonts, logo, and layout settings.
  </Card>
  <Card title="Set up your domain" href="/guides/custom-domain" icon="globe">
    Publish your docs to a custom domain.
  </Card>
</Columns>
```

At decision points, cards with descriptive content let readers self-select their path:

```mdx Decision point theme={null}
<Columns cols={2}>
  <Card title="I'm setting up docs for the first time" href="/guides/new-project" icon="sparkles">
    Start here to create a new Mintlify project from scratch.
  </Card>
  <Card title="I'm migrating from another platform" href="/guides/migrate" icon="move-right">
    Import existing content and configure your new Mintlify site.
  </Card>
</Columns>
```

## Card variations

Image cards work for course indexes, product listings, or anywhere visual differentiation helps users scan. Use them when the image communicates something the title alone doesn't.

```mdx Image card theme={null}
<Card title="Git and GitHub for Mintlify" href="/courses/git-github/why-docs-teams-use-git" img="/assets/courses/git.png">
  <span>8 lessons</span>
  Learn the foundations of a docs-as-code workflow.
</Card>
```

Horizontal cards create a more compact, list-like layout.

```mdx Horizontal card theme={null}
<Card title="API reference" href="/api-reference" icon="code" horizontal>
  Full endpoint documentation with request and response schemas.
</Card>
```

## When not to use cards

Don't use cards as styled bullet lists. If a card has a title but no link or child content in the card, it's probably meant to be an unordered list item.

Don't embed a single card in the middle of a long section of prose. Cards create a visual break. Put them at natural stopping points, not mid-paragraph.

<Quiz
  question="You have an SDK reference page with five methods all on the same page. You want readers to be able to jump to each one. Is a card grid the right approach?"
  answers={[
{ text: "Yes. Cards are great for navigating to specific content.", correct: false },
{ text: "No. Use anchor links or a table of contents instead. Cards are for cross-page navigation.", correct: true },
{ text: "Yes. Horizontal cards would work well for five items.", correct: false },
{ text: "No. Use an accordion for each method so the page stays compact.", correct: false },
]}
  correctFeedback="Right. Cards are for navigating between pages, not between headings on the same page. Mintlify generates a table of contents automatically from your headings. Cards here would be visual overhead for something the sidebar already handles."
  incorrectFeedback="Cards are cross-page navigation. For within-page navigation, anchor links and the automatic table of contents are the right tools. Using cards for method links within a reference page adds visual weight without adding value."
/>

<Check>
  Next up: [Inline links or cards — when to use each one](/courses/components/links-vs-cards) — How to choose the right navigation component based on context and intent.
</Check>
