MDX components

A small set of components to keep documentation consistent and easy to scan.

Admonitions

Use admonitions for short callouts. Prefer them over long paragraphs of warnings.

Note

Keep notes short: one idea, one recommendation.

Steps

Use steps when order matters.

  1. 1

    Do the smallest viable thing

    Keep each step focused on a single action and show the command or snippet.

  2. 2

    Verify the result

    Prefer a concrete “what to look for” instead of a generic “it should work”.

Cards and grids

Use cards to link to related pages without writing large “Next steps” paragraphs.

Code tabs

Use code tabs when you show the same idea in different languages.

type User = { id: string; name: string };

Tabs

Use tabs when you want to present multiple approaches without duplicating the whole page. Tabs work best for short, explanatory content.

Tabs are great for comparing alternatives, like server-first vs client-first approaches, or different configuration strategies.

Accordions

Use accordions for optional details that would otherwise interrupt the main flow of a page.

If a step fails, copy the exact command output and verify you are using the recommended Node.js version.

Tables

Use tables for compact comparisons. Always add a short paragraph before the table so readers know what the table is answering.

ComponentBest forAvoid when
StepsOrdered workflowsThere is no required order
Grid + CardNavigation and “next steps”You need long prose explanations
AdmonitionShort calloutsThe “callout” becomes the main article

FileSystem

Use FileSystem to illustrate folder layout and highlight the file the reader should edit.

src/content/docs
meta.json
content
mdx-components.md

Package manager blocks

If you want to show an install command once and render it for different package managers, use an npm code block.

npm install next react react-dom