Copy Command Block

A multi-package manager terminal command box with tab switcher (npm, pnpm, yarn, bun), persistent storage, copy feedback animation, and blueprint styling.

Multi-Package Manager Install Command:
$
npx shadcn@latest add @akoder/dotted-world-map
Single Standalone Command:
$
git clone https://github.com/AdityaKodez/adityaojha.git

Installation

Copy Command Block is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.

$npx shadcn@latest add https://akoder.xyz/r/copy-command-block.json

Install often? Register the namespace once in components.json and use the shorter form npx shadcn@latest add @akoder/copy-command-block.

Usage

import { CopyCommandBlock } from "@/components/ui/copy-command-block";
 
export function InstallationGuide() {
  return (
    <CopyCommandBlock
      commands={{
        npm: "npm install @tanstack/react-query",
        pnpm: "pnpm add @tanstack/react-query",
        yarn: "yarn add @tanstack/react-query",
        bun: "bun add @tanstack/react-query",
      }}
    />
  );
}

Props

PropTypeDefaultNotes
commandsRecord<"npm" | "pnpm" | "yarn" | "bun", string> | stringundefinedPer-package-manager command mapping or template string with {pm}, {runner}, or {add}.
commandstringundefinedSingle fixed command string (disables tabs).
storageKeystring"akoder:package-manager"LocalStorage key used to synchronize the user's preferred package manager across the entire site.
showTabsbooleantrueWhen true and multiple commands provided, displays package manager switcher tabs.
showPromptbooleantrueRenders terminal prompt indicator ($).
classNamestringExtra CSS classes for wrapper container.

Notes & Features

Manual installation

Copy components/ui/copy-command-block.tsx into your project. Ensure lucide-react, motion, and the shadcn tooltip component are present.

Examples

Explore different presets, palettes, and configurations.

Standalone Git Command

Single-line shell command without tabs.

$
git checkout -b feature/registry-blocks

Example 1 of 2: Standalone Git Command