"use client";
import { InstallCommand } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
packages (required) | string | readonly string[] | — | Package name(s): "pkg", "a b" or ["a", "b"]. |
defaultManager | PackageManager | first manager | Manager shown on the server and before a remembered choice is read (default: the first of managers). |
dev | boolean | — | Install as a dev dependency (npm install --save-dev, pnpm add -D, yarn add -D, bun add -d). |
global | boolean | — | Install a CLI globally (npm install --global, pnpm add --global, yarn global add (Yarn 1), bun add --global). Excludes dev. Shares the remembered manager with the project installs on the page. |
label | string | "Package manager" from the catalog | Name of the tab list (default "Package manager" from the catalog). |
language | string | "bash" | Language label of the code card (default "bash"). |
managers | readonly PackageManager[] | ["npm", "pnpm", "yarn", "bun"] | Managers shown as tabs, in order (default ["npm", "pnpm", "yarn", "bun"]). |
onManagerChange | (manager: PackageManager) => void | — | Called when the reader picks a manager in this InstallCommand. |
storageKey | string | false | "pixxl-package-manager" | localStorage key that remembers the choice across reloads; every InstallCommand with the same key shares (and syncs) it, also across tabs. Default "pixxl-package-manager"; false keeps the choice in this instance only (not remembered, not shared). |
title | ReactNode | — / bash | Card title (e.g. "Install"). |
packagesrequiredstring | readonly string[]
Package name(s): "pkg", "a b" or ["a", "b"].
defaultManagerdefault first managerPackageManager
Manager shown on the server and before a remembered choice is read (default: the first of managers).
devboolean
Install as a dev dependency (npm install --save-dev, pnpm add -D, yarn add -D, bun add -d).
globalboolean
Install a CLI globally (npm install --global, pnpm add --global, yarn global add (Yarn 1), bun add --global). Excludes dev. Shares the remembered manager with the project installs on the page.
labeldefault "Package manager" from the catalogstring
Name of the tab list (default "Package manager" from the catalog).
languagedefault "bash"string
Language label of the code card (default "bash").
managersdefault ["npm", "pnpm", "yarn", "bun"]readonly PackageManager[]
Managers shown as tabs, in order (default ["npm", "pnpm", "yarn", "bun"]).
onManagerChange(manager: PackageManager) => void
Called when the reader picks a manager in this InstallCommand.
storageKeydefault "pixxl-package-manager"string | false
localStorage key that remembers the choice across reloads; every InstallCommand with the same key shares (and syncs) it, also across tabs. Default "pixxl-package-manager"; false keeps the choice in this instance only (not remembered, not shared).
titledefault — / bashReactNode
Card title (e.g. "Install").
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
npm install simple-ascii-chartsimple-ascii-chart (npm)Complex object props use fixed fixtures. Primitive props stay editable.
<InstallCommand packages="simple-ascii-chart" />npm install @pixxl-tools/components@pixxl-tools/components (npm)npm install --save-dev typescript @types/reactDev dependencies (npm, dev)<InstallCommand packages="@pixxl-tools/components" />
<InstallCommand dev packages={["typescript", "@types/react"]} />npm install simple-ascii-chartsimple-ascii-chart (npm)<InstallCommand packages="simple-ascii-chart" />