---
title: Steps, tabs and code
description: Sequences, alternatives, and code presentation.
---

Six components for procedures and code.

## `Steps` and `Step`

<ParamField name="titleSize" type='"p" | "h2" | "h3" | "h4"' default="p">
  Heading level for each step's title. On `Steps`.
</ParamField>

**`Steps` children: `Step` only, at least two.** A one-step sequence is not a sequence,
and the check enforces it.

On `Step`:

<ParamField name="title" type="string" required>
  The step's heading.
</ParamField>

<ParamField name="id" type="string">
  Stable anchor for deep links.
</ParamField>

<ParamField name="icon" type="icon">
  Icon beside the title.
</ParamField>

<ParamField name="stepNumber" type="number">
  Overrides the automatically assigned number.
</ParamField>

```mdx
<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`

<ParamField name="sync" type="boolean" default="true">
  Selecting a tab selects the same-titled tab in every other group on the page. On `Tabs`.
</ParamField>

<ParamField name="defaultTabIndex" type="number" default="0">
  Which tab starts selected. On `Tabs`.
</ParamField>

**`Tabs` children: `Tab` only, at least two.**

On `Tab`:

<ParamField name="title" type="string" required>
  The tab label.
</ParamField>

<ParamField name="id" type="string">
  Stable identifier.
</ParamField>

<ParamField name="icon" type="icon">
  Icon in the label.
</ParamField>

<ParamField name="language" type="string">
  Marks the tab as carrying code in this language.
</ParamField>

`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`

<ParamField name="title" type="string">
  Filename or label shown in the block's header.
</ParamField>

<ParamField name="language" type="string">
  Syntax highlighting language.
</ParamField>

<ParamField name="showLineNumbers" type="boolean" default="false">
  Renders line numbers.
</ParamField>

<ParamField name="startLine" type="number" default="1">
  First line number when numbering is on.
</ParamField>

<ParamField name="maxLines" type="number">
  Scrolls beyond this height instead of growing.
</ParamField>

<ParamField name="wordWrap" type="boolean" default="false">
  Wraps long lines instead of scrolling horizontally.
</ParamField>

<ParamField name="highlight" type="string">
  Line range to emphasize, e.g. `"3-5"`.
</ParamField>

<ParamField name="focus" type="string">
  Line range to focus, dimming the rest.
</ParamField>

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`

<ParamField name="dropdown" type="boolean" default="false">
  Renders the selector as a dropdown rather than a tab strip.
</ParamField>

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