Skip to Content

Tabs

Alternatives, such as one command per package manager.

Tabs hold versions of the same content. The reader picks one, and the page shows only that one.

npm install

MDX

<Tabs items={['npm', 'pnpm', 'bun']}>
  <Tab value="npm">
    ```bash
    npm install
    ```
  </Tab>
  <Tab value="pnpm">
    ```bash
    pnpm install
    ```
  </Tab>
</Tabs>

Remembering the choice

Give tabs a groupId to share the choice across the page. Add persist to keep it across visits.

<Tabs groupId="package-manager" persist items={['npm', 'pnpm']}>

Code block tabs

Code blocks with a tab attribute next to each other become one block with tabs:

```bash tab="Linux"
./install.sh
```

```powershell tab="Windows"
.\install.ps1
```
./install.sh
Edit on GitHub

Last updated on

On this page