Matrix logo

Using Components

Choose the right MDX component for the job: when to use Cards, Callouts, Tabs, Steps, CodeGroups, and API documentation components.

MDX components are available in every page without imports. This guide helps you pick the right one for each situation. For live examples of every component, see the Components section in the sidebar.

Highlighting information

Use callout components to draw attention to important content:

Note -- Helpful context that enhances understanding but is not required reading.

Info -- Neutral facts or supplementary details worth highlighting.

Tip -- Best practices, shortcuts, and recommendations.

Warning -- Important caveats, requirements, or common pitfalls.

Danger -- Critical warnings about data loss, security, or irreversible actions.

Check -- Success confirmations or completed steps.

Use the lightest callout that conveys the urgency. If everything is a warning, nothing is.

<Note>

Helpful context or supplementary information.

</Note>

<Warning>

Important caveats or requirements.

</Warning>

Linking to other pages

ComponentWhen to use
CardA single feature or destination with a title, icon, and optional link.
ColumnsA responsive grid of cards (2, 3, or 4 columns). Wraps multiple Card children.
<Columns cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">

    Get up and running in minutes.

</Card>
  <Card title="Components" icon="puzzle-piece" href="/components/cards">

    See every built-in component.

</Card>
</Columns>

Showing alternatives or steps

ComponentWhen to use
Tabs + TabEqual alternatives the reader chooses between (languages, platforms, OSes).
AccordionGroup + AccordionCollapsed-by-default details (FAQs, advanced options, troubleshooting).
Steps + StepA linear sequence the reader walks through in order.
CodeGroupMulti-language code blocks side by side with a shared tab strip.

The decision is straightforward:

  • If readers do all the work, use Steps.
  • If they pick one path, use Tabs.
  • If most readers skip it, use AccordionGroup.
<Steps>
  <Step title="First">Do this first.</Step>
  <Step title="Second">Then do this.</Step>
</Steps>

Documenting APIs

ComponentWhen to use
ParamFieldA request parameter (path, query, header, body).
ResponseFieldA response field in the return payload.
RequestExampleThe request code samples panel.
ResponseExampleThe response payload panel.

These components are designed for API reference pages. They render type badges, required indicators, and structured parameter lists.

Code blocks

ComponentWhen to use
Fenced code blockA single code example with syntax highlighting.
Code block with titleA code example labeled with its filename.
CodeGroupThe same example in multiple languages, shown as tabs.

See Code Blocks for syntax and examples.

For the full component reference with every prop and variant, see the individual pages in the Components section of the sidebar.