Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-copy-button.json --yes

Copy button

Pro

A button that copies a value such as a link, a key or a command to the clipboard and says it was copied in place, for React and Tailwind CSS. Part of Goop Pro.

When to use

  • A button that copies a value such as a link, a key or a command to the clipboard and says it was copied in place.
  • Also called: copy to clipboard.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Copy button on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-copy-button.json --yes
PROMPT
Add the Goop Copy button to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { CopyButton } from '@/components/ui/goop/copy-button';
import { TextInput } from '@/components/ui/goop/text-input';

function ApiKeyRow() {
  const key = 'key_live_7Hq2xV9mK4tR8wN3cL6p';
  return (
    <div className="flex flex-col items-start gap-3">
      <div className="flex w-full items-center gap-2">
        <TextInput aria-label="API key" readOnly value={key} className="min-w-0 flex-1 text-ellipsis" />
        <CopyButton value={key} label="Copy key" variant="outline" size="lg" />
      </div>
      <CopyButton value="https://example.com/invite/7f3a9c" label="Copy invite link" iconOnly size="md" />
    </div>
  );
}
  • Also known as: CopyToClipboard, ClipboardButton, Clipboard.
  • Put a CopyButton at the end of any value a person will paste elsewhere — a key, a link, an id — and let it confirm in place; a value shown in the theme's mono is a CodeBlock, which has its own copy button. Never a Toast for the confirmation.
  • height, padding: add no class for these.

API reference

Options
OptionTypeWhat it does
valuestringWhat is copied: the exact text put on the clipboard.
label?string = 'Copy'The words at rest; with iconOnly, the button's name and its tooltip — say what is copied ("Copy API key").
copiedLabel?string = 'Copied'The words once the value is on the clipboard.
failedLabel?string = 'Couldn’t copy'The words when the copy failed.
iconOnly?boolean = falseThe glyph alone, on the theme's quiet IconButton; label names it and shows in its tooltip.
variant?'ghost' | 'outline' = 'ghost'ghost (no fill at rest) or outline (the card fill: inside its 1 px grey edge at lg, the raised chip's soft drop at sm and md).
size?'sm' | 'md' | 'lg' = 'sm'sm and md 28 px with words (24 and 28 px for the glyph alone), lg 40 px (beside a TextInput).
onCopy?(value: string) => voidCalled with value once it is on the clipboard.
onClick?(event: MouseEvent) => void
disabled?boolean
  • data-slot values (to select a part by): copy-button, copy-button-status, copy-button-text

Keyboard

KeyWhat it does
EnterCopy the value; the focus stays on the button
SpaceCopy the value; the focus stays on the button

Accessibility

  • The part itself answers the keys above.
  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe prop disabled

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/copy-button.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-copy-button.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.