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

PropTypeDefaultDescription
optionsInstallOption[]Array of installation options with id, label, and command properties.

InstallOption Interface

Structure for individual installation options within the options array.

PropertyTypeDefaultDescription
idstringUnique identifier for the option, used for state management and localStorage.
labelstringDisplay text shown on the tab button.
commandstringCommand string displayed in the code block when the option is active.