> ## 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.

# Small components with specific jobs

> Know when a tooltip, update, panel, prompt, tile, icon, or color swatch earns its place on the page.

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>;
};

Some components solve one narrow problem like defining a term, formatting a changelog entry, pinning an example beside the content, or giving readers a prompt they can copy.

Before adding one of these components, identify what problem it solves. If the only reason you're about to use a component is because “the page looks plain,” text is probably a better choice than a component.

## Define a term without sending readers away

A tooltip works for a short definition that helps in the moment:

```mdx theme={null}
The <Tooltip tip="A saved snapshot of changes in Git">commit</Tooltip> is now on your branch.
```

The sentence still makes sense if someone doesn't open the tooltip. That's important because hover interactions are easy to miss and work differently on touch devices.

Keep instructions, required context, and links in the page itself. A tooltip should save a quick detour, not conceal part of the task.

## Give release notes a consistent shape

The `<Update>` component is built for dated changelog entries:

```mdx theme={null}
<Update label="2026-08-03" description="CLI improvements" tags={["CLI"]}>
  The local preview now reports broken links before startup completes.
</Update>
```

Its label creates an anchor, and its tags help readers filter the changelog. That behavior is useful on a release-notes page but unnecessary inside an ordinary guide. When a product change affects the current instructions, update the guide rather than inserting a permanent release announcement into it.

## Trade the table of contents for a side panel

`<Panel>` replaces the page's table of contents with content you choose. API reference pages use this space well: a request and response can stay visible beside the field descriptions they support.

That tradeoff is less attractive on a long guide. If readers rely on the table of contents to move between sections, replacing it with a tip or promotional card makes the page harder to navigate.

Use a panel when the sidebar content supports the entire page and is more useful than section links—not simply because the sidebar is available.

## Give readers prompts they can actually run

Use `<Prompt>` when the content is meant to be copied into an AI tool:

```mdx theme={null}
<Prompt description="Review a page for unclear prerequisites">
Read this documentation page and list every prerequisite it assumes.
For each one, quote the heading where it should be introduced.
</Prompt>
```

A useful prompt says what to inspect and what to return. “Improve this page” leaves both decisions to the tool and gives readers little idea what result to expect.

If the text is a shell command or code sample, keep it in a code block. The Prompt component is for instructions to an AI tool, not anything that happens to be copyable.

## Use visual helpers only when they add information

Tiles combine navigation with a visual preview. They work well for a gallery where the preview helps readers choose, such as themes or component examples. If the image adds nothing beyond the title, use a card or a normal link.

Icons help distinguish repeated items, but always pair them with a label. A symbol that feels obvious to your team may mean something different to a reader.

Color swatches belong in brand and design-system references where the color value is itself the subject. They aren't a substitute for explaining status or meaning in text.

<Quiz
  question="You want readers to copy a detailed instruction into an AI coding tool. The instruction specifies which file to review and the format of the response. Which component fits best?"
  answers={[
{ text: "Prompt, because the content is an instruction for an AI tool", correct: true },
{ text: "A code block, because anything copyable belongs in code", correct: false },
{ text: "Panel, because the instruction should stay visible while reading", correct: false },
{ text: "Tooltip, because the instruction is supplementary", correct: false },
]}
  correctFeedback="Right. Prompt gives the instruction a clear copy action and identifies it as something to run in an AI tool."
  incorrectFeedback="Use Prompt for an instruction intended for an AI tool. A code block signals code or commands, while panels and tooltips solve different layout problems."
/>

That's the end of the components course. When you're unsure about a component, write the content in plain Markdown first. Add the component only if it makes the result easier to find, follow, or understand.
