Markdown in, stunning docs out. No JavaScript toolchain, no config. ⭐ Star us on GitHub

Tabs

Tabs let you organize related content into switchable panels, perfect for showing alternatives like different programming languages or platforms.

Basic Tabs

javascript
console.log('Hello, world!');
markdown
<Tabs>
  <Tab name="JavaScript">
    ```javascript
    console.log('Hello, world!');
    ```
  </Tab>
  <Tab name="Python">
    ```python
    print('Hello, world!')
    ```
  </Tab>
  <Tab name="Dart">
    ```dart
    print('Hello, world!');
    ```
  </Tab>
</Tabs>

Tabs with Rich Content

Tabs can contain any Markdown content, not just code:

Installing on macOS

Use Homebrew for the easiest installation:

bash
brew install stardust

Or download the binary directly from the releases page.

Package Manager Examples

A common use case — showing installation commands for different package managers. Add group="pkg-manager" so every package-manager block on the page (and across your site) stays in sync:

bash
npm install my-package
markdown
<Tabs group="pkg-manager">
  <Tab name="npm">
    ```bash
    npm install my-package
    ```
  </Tab>
  <Tab name="yarn">
    ```bash
    yarn add my-package
    ```
  </Tab>
  <Tab name="pnpm">
    ```bash
    pnpm add my-package
    ```
  </Tab>
  <Tab name="bun">
    ```bash
    bun add my-package
    ```
  </Tab>
</Tabs>

Framework Comparison

jsx
function App() {
  return <h1>Hello, React!</h1>;
}

Best Practices

Info

  • Use tabs when showing equivalent alternatives (languages, platforms, methods)
  • Keep tab names short and descriptive
  • Ensure each tab has similar content structure
  • Don't nest tabs inside tabs

Synced & Persistent Selection

Give related tab groups a shared group and they switch together — and the choice is remembered across reloads and every other page via localStorage. It's ideal for package managers or operating systems repeated throughout your docs: the reader picks once and the whole site follows.

Matching is by tab label, so <Tab name="pnpm"> syncs to every other pnpm tab in the same group, regardless of order. Tab groups without a group stay independent.

Variable declaration in Python:

python
name = "Stardust"

Function definition in Python:

python
def greet(name):
    return f"Hello, {name}!"

Select a language above and watch both groups sync — then reload the page and your choice sticks.

markdown
<Tabs group="lang">
  <Tab name="Python">...</Tab>
  <Tab name="JavaScript">...</Tab>
</Tabs>
3 min readLast updated 2026-07-26Samuel Abada