Component
Install Tabs
Interactive tabs for switching between different installation methods. Also persists the selected option.
Installation
Usage
Package Manager Selection
1const installOptions = [
2 { id: 'npm', label: 'npm', command: 'npm install ' },
3 { id: 'pnpm', label: 'pnpm', command: 'pnpm add ' },
4 { id: 'yarn', label: 'yarn', command: 'yarn add ' },
5]
6
7<InstallTabs options={installOptions} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| options | InstallOption[] | — | Array of installation options with id, label, and command properties. |
InstallOption Interface
Structure for individual installation options within the options array.
| Property | Type | Default | Description |
|---|---|---|---|
| id | string | — | Unique identifier for the option, used for state management and localStorage. |
| label | string | — | Display text shown on the tab button. |
| command | string | — | Command string displayed in the code block when the option is active. |