Skip to content
Documentation
nextra-theme-docs
Built-ins
Tabs

Tabs

Tab Component

A built-in tab component of the Docs Theme.

Example

pNPM: Fast, disk space efficient package manager.

Usage

Default


_10
import { Tab, Tabs } from '@visulima/nextra-theme-docs'
_10
_10
<Tabs items={['pnpm', 'npm', 'yarn']}>
_10
<Tab>**pNPM**: Fast, disk space efficient package manager.</Tab>
_10
<Tab>
_10
**npm** is a package manager for the JavaScript programming language.
_10
</Tab>
_10
<Tab>**Yarn** is a software packaging system.</Tab>
_10
</Tabs>

Default Selected Index

You can use the defaultIndex prop to set the default tab index:


_10
import { Tab, Tabs } from '@visulima/nextra-theme-docs'
_10
_10
<Tabs items={['pnpm', 'npm', 'yarn']} defaultIndex="1">
_10
...
_10
</Tabs>

And you will have npm as the default tab: