---
title: "Tabs"
subtitle: "<Tabs> (alias <TabGroup>) and <Tab> put parallel content into tabs, with the selection synced across pages."
---

Put parallel content in tabs (alias `<TabGroup>`). Switching works even without JavaScript.

````mdx
<Tabs>
  <Tab title="macOS" icon="fa-brands fa-apple">
    ```bash
    brew install node
    ```
  </Tab>
  <Tab title="Windows" icon="fa-brands fa-windows">
    Download the installer from nodejs.org.
  </Tab>
  <Tab title="Linux" icon="fa-brands fa-linux">
    Use your distribution's package manager, or nvm.
  </Tab>
</Tabs>
````

<Tabs>
  <Tab title="macOS" icon="fa-brands fa-apple">
    ```bash
    brew install node
    ```
  </Tab>
  <Tab title="Windows" icon="fa-brands fa-windows">
    Download the installer from nodejs.org.
  </Tab>
  <Tab title="Linux" icon="fa-brands fa-linux">
    Use your distribution's package manager, or nvm.
  </Tab>
</Tabs>

## Cross-page sync

There are three ways to sync. The selection is saved in the browser and still applies when you visit other pages:

| Syntax | Sync scope |
|---|---|
| `<Tab language="python">` | Syncs with every code group, API example, and tab of the same language across the site |
| `<Tabs group="os">` | Syncs with tabs across the site that have the same `group` and the same title |
| `<Tabs sync>` | Syncs by title with every tab that sets `sync` |

The two tab sets below share `group="os"`; switch one and the other follows:

<Tabs group="os">
  <Tab title="macOS">First set: macOS</Tab>
  <Tab title="Linux">First set: Linux</Tab>
</Tabs>

<Tabs group="os">
  <Tab title="macOS">Second set: macOS</Tab>
  <Tab title="Linux">Second set: Linux</Tab>
</Tabs>

## Tabs props

<ParamField path="group" type="string">Sync group (`syncKey` and `groupId` also work).</ParamField>
<ParamField path="sync" type="boolean" default="false">Sync by title with every tab that sets `sync`.</ParamField>
<ParamField path="defaultTabIndex" type="number" default="0">Initially selected tab (zero-based; `defaultIndex` also works).</ParamField>

## Tab props

<ParamField path="title" type="string" required>Tab label.</ParamField>
<ParamField path="language" type="string">Shares a sync key with code blocks of the same language across the site.</ParamField>
<ParamField path="icon" type="icon">Icon before the label.</ParamField>
<ParamField path="id" type="string">Panel id; visiting `#id` selects this tab automatically.</ParamField>
