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
idstring—Unique identifier for the option, used for state management and localStorage.
labelstring—Display text shown on the tab button.
commandstring—Command string displayed in the code block when the option is active.