npm install @assistant-ui/reactInstallation
Copy the source into components/ui/command-tabs.tsx. Registry items that depend on it install it automatically.
Usage
import { CommandTabs } from "@/components/ui/command-tabs";
export function Example() {
return (
<CommandTabs
storageKey="package-manager"
commands={{
npm: "npm install @assistant-ui/react",
pnpm: "pnpm add @assistant-ui/react",
}}
/>
);
}The command renders as plain mono text; the copy button always copies the active dialect.
Examples
Synced instances
Two blocks sharing a storageKey switch together, and the choice survives reloads. Every install command on this site shares one key.
npx assistant-ui initnpx shadcn@latest add @assistant-ui/threadAPI Reference
CommandTabs
CommandTabsPropscommands: Record<string, string>Tab label to command line, in display order.
storageKey?: stringPersists the selected tab in localStorage and keeps every instance with the same key in sync.
onValueChange?: (value: string) => voidCalled when the user picks a tab.
className?: stringAdditional CSS classes on the outer figure.