Skip to content
Components / Documentation

Package install

A command in npm, pnpm, yarn and bun. Choosing one switches every command on the page.

@fabrials/ui
Loading state
npx shadcn@latest add @fabrials/button @fabrials/files
npm install @fabrials/ui

Choose pnpm in one and the other follows.

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { PackageInstall, packageCommand } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
commandstringWithout the runner: shadcn@latest add @fabrials/button.
kindrun | installrun uses npx, pnpm dlx, yarn dlx and bunx; install uses npm install, pnpm add, yarn add and bun add.
persistKeystring | nullRemembers the choice in this browser under that key; null forgets it.

Behavior

The saved choice is read after hydration, so the server and the first render agree on npm.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.