Command Palette

Search for a command to run...

Components

Package Manager Tabs

A CLI command block with a package manager switcher. Supports npm, pnpm, yarn, and bun with per-manager commands and a one-click copy button.

Features

Installation

1

Run the shadcn CLI command

npx shadcn@latest add @lalit/package-manager-tabs
pnpm dlx shadcn@latest add @lalit/package-manager-tabs
npx shadcn@latest add @lalit/package-manager-tabs
bunx shadcn@latest add @lalit/package-manager-tabs

This installs the component directly. Update import paths to match your setup.

Usage

import { PackageManagerTabs } from '@/components/ui/package-manager-tabs'

export function Example() {
  return (
    <PackageManagerTabs
      commands={{
        npm: 'npx shadcn@latest add @lalit/copy-button',
        pnpm: 'pnpm dlx shadcn@latest add @lalit/copy-button',
        yarn: 'npx shadcn@latest add @lalit/copy-button',
        bun: 'bunx shadcn@latest add @lalit/copy-button',
      }}
    />
  )
}

API Reference

PropTypeDefaultDescription
commands*
CommandsPer-package-manager command strings. Keys: npm, pnpm, yarn, bun.
variant
"default" | "glass""default"Visual style. "glass" renders a frosted-glass surface with backdrop blur, optimised for both light and dark modes.
className
stringAdditional classes for the root wrapper.