/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog

Tabs

Tabbed content for showing multiple options or variants.

3 min read

Tabs organize content into switchable panels, perfect for showing multiple options, code variants, or platform-specific instructions.

Basic Tabs

mdx
<Tabs>
<Tab title="npm">
```bash
npm install @syntext/sdk
```
</Tab>
<Tab title="yarn">
```bash
yarn add @syntext/sdk
```
</Tab>
<Tab title="pnpm">
```bash
pnpm add @syntext/sdk
```
</Tab>
</Tabs>
npmyarnpnpm
bash
npm install @syntext/sdk

With Rich Content

Tabs can contain any content, not just code:

mdx
<Tabs>
<Tab title="macOS">
## Installation on macOS
Download the installer from our website or use Homebrew:
```bash
brew install myapp
```
</Tab>
<Tab title="Windows">
## Installation on Windows
Download the `.exe` installer from our website or use winget:
```powershell
winget install myapp
```
</Tab>
<Tab title="Linux">
## Installation on Linux
Use your distribution's package manager:
```bash
# Debian/Ubuntu
apt install myapp
# Fedora
dnf install myapp
```
</Tab>
</Tabs>
macOSWindowsLinux

Installation on macOS

Download the installer or use Homebrew:

bash
brew install myapp

With Icons

Add icons to tab titles:

mdx
<Tabs>
<Tab title="TypeScript" icon="typescript">
TypeScript content...
</Tab>
<Tab title="Python" icon="python">
Python content...
</Tab>
</Tabs>

Synced Tabs

Tabs with the same group ID stay in sync across the page:

mdx
<Tabs group="language">
<Tab title="Node.js">Node content 1</Tab>
<Tab title="Python">Python content 1</Tab>
</Tabs>
<!-- Later on the page... -->
<Tabs group="language">
<Tab title="Node.js">Node content 2</Tab>
<Tab title="Python">Python content 2</Tab>
</Tabs>

When you select a tab in one group, all matching groups update.

Tab Props

PropTypeDescription
titlestringTab label (required). Without it tabs are labelled "Tab 1", "Tab 2", and so on
iconstringOptional icon: a name from the icon set, or a language glyph such as typescript, python, go, rust, curl (typescript, javascript, python, go, ruby, php, java, bash, shell, rust, curl, file — on doc engine v1 and v2). An unknown name draws nothing
childrenReactNodeTab content

Tabs Props

PropTypeDescription
groupstringSync ID for linked tabs
variant"underline"Flat text tabs over a rule that scroll sideways when they overflow. Omit for the default pill row
childrenTab[]Tab components

Underline variant

mdx
<Tabs variant="underline">
<Tab title="Overview">Overview content</Tab>
<Tab title="Configuration">Configuration content</Tab>
</Tabs>
OverviewConfiguration

Overview content

CodeGroup vs Tabs

Use <CodeGroup> for code-only content, where the reader's language choice can carry across pages:

TypeScriptPython
const result = await fetch(url);

Use <Tabs> for mixed content or non-code options:

CloudSelf-Hosted

Sign up at syntext.dev and follow the onboarding flow.

Keyboard and screen readers

A tab bar is a real ARIA tablist: each label is a tab, each panel is a tabpanel wired to the label that controls it, and the whole group is a single Tab stop. Once a label has focus, ← and → (or ↑ / ↓) move between tabs, Home jumps to the first and End to the last. <CodeGroup> language rows and the request-sample language row on API reference pages behave the same way.

<Tabs> renders on guide pages and on API reference pages alike.

Without JavaScript

If the page's script does not run, a tabbed group falls back to plain stacked content: every panel is shown in source order, with its title above it. Nothing an author wrote is hidden behind a control that cannot appear. <CodeGroup>, <Accordion> and <Expandable> degrade the same way.

That fallback is doc engine v1 behaviour. On doc engine v2, only the active tab and accordions that start open are shown without JavaScript.

Best Practices

Tip

Keep tab titles short (1-2 words). Use icons to add context without lengthening titles.

•
Use consistent tab order across the site
•
Ensure all tabs have roughly equal content
•
Don't nest tabs inside tabs
•
Use group prop for related tab sets that should sync
Was this page helpful? Yes No
Previous
Next
Product
Resources
Company
© 2026 SyntextBuilt with Syntext