Steps, tabs and code
Sequences, alternatives, and code presentation.
Six components for procedures and code.
Steps and Step
Section titled “Steps and Step”titleSize"p" | "h2" | "h3" | "h4"default: pHeading level for each step’s title. On Steps.
Steps children: Step only, at least two. A one-step sequence is not a sequence,
and the check enforces it.
On Step:
titlestringrequiredThe step’s heading.
idstringStable anchor for deep links.
iconiconIcon beside the title.
stepNumbernumberOverrides the automatically assigned number.
<Steps> <Step title="Install">Add the dependency.</Step> <Step title="Authenticate">Set your API key in the environment.</Step></Steps>Keep fenced code blocks at the top level of the page rather than inside a <Step> —
MDX parses fences differently inside JSX, which is a common source of confusing build
failures. Use title plus prose in the step, and put the command below the list.
Tabs and Tab
Section titled “Tabs and Tab”syncbooleandefault: trueSelecting a tab selects the same-titled tab in every other group on the page. On Tabs.
defaultTabIndexnumberdefault: 0Which tab starts selected. On Tabs.
Tabs children: Tab only, at least two.
On Tab:
titlestringrequiredThe tab label.
idstringStable identifier.
iconiconIcon in the label.
languagestringMarks the tab as carrying code in this language.
sync defaults to on: a reader who picks Python once sees Python in every group further
down the page. That is usually what you want — turn it off when tabs on the same page
mean unrelated things.
CodeBlock
Section titled “CodeBlock”titlestringFilename or label shown in the block’s header.
languagestringSyntax highlighting language.
showLineNumbersbooleandefault: falseRenders line numbers.
startLinenumberdefault: 1First line number when numbering is on.
maxLinesnumberScrolls beyond this height instead of growing.
wordWrapbooleandefault: falseWraps long lines instead of scrolling horizontally.
highlightstringLine range to emphasize, e.g. "3-5".
focusstringLine range to focus, dimming the rest.
Children: inline content — the code itself.
A plain fenced code block is the right default. Reach for CodeBlock when you need a
title, line numbers, or emphasis.
CodeGroup
Section titled “CodeGroup”dropdownbooleandefault: falseRenders the selector as a dropdown rather than a tab strip.
Children: CodeBlock only, at least one. Use it for one operation shown in several
languages — the generated API pages use exactly this shape for their five HTTP snippets.