Search

Search components and flows across the catalog

ThatDesignUIOriginalInteractive preview

Copy command button

A dark terminal chip showing an install command; clicking copies it, the copy icon morphs into a check and a Copied tooltip appears.

Category
Buttons
Platform
Responsive

Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Default state

Use this component

Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.

FreeReact 18+Tailwind v3.4 or v4No extra packages

1. Add it with the shadcn CLI

npx shadcn@latest add https://www.thatdesignui.com/r/copy-command-button.json

2. Use it

Every prop is optional
app/page.tsx
import CopyCommandButton from "@/components/copy-command-button";

export default function Page() {
  return <CopyCommandButton />;
}

Prefer to paste it yourself? Open the .

Under the hood

How it’s built

What’s inside

  1. A 56px near-black (#0c0c0e) chip, rounded 12px, monospace 14px text with a grey $ prompt, and a 36px icon tile on the right.
  2. Clicking copies the command, cross-fades the copy icon into a green check on a dark green tile, and slides a small black Copied tooltip in above for 1.6 seconds.
  3. If the clipboard is blocked the tooltip says Couldn't copy instead.

How it behaves

  • Clicking really copies the command text to the clipboard.
  • The button's accessible name includes the full command.
  • The Copied or Couldn't copy message is announced.
  • Clicking again while showing Copied restarts the timer.

More from ThatDesignUI

Image gallery lightbox

Image gallery lightbox

ThatDesignUIOriginalMedia component

Notification center

Notification center

ThatDesignUIOriginalNotifications component

Interactive chart card

Interactive chart card

ThatDesignUIOriginalDashboard component

Multi-select combobox

Multi-select combobox

ThatDesignUIOriginalForms component