Copy to Clipboard Button

A click to copy button for install commands, API keys, and coupon codes with copied feedback.

Installation

Adds the component and everything it depends on to your project.

npx shadcn add https://ui.beste.co/component/r-base/button17

New here? Read the installation guide.

Usage

The import and the props worth knowing about, in one place.

import { Button17 } from "@/components/beste/component/button17";

// Copies `value` on click; icon flips to a check while copied.
<Button17 value="npx shadcn@latest init" prefix="$" />

<Button17
  value="SAVE20"
  label="Use code SAVE20"   // display text (defaults to value)
  tone="dark"               // "neutral" (default) | "dark"
  resetDelay={3000}         // ms the copied state is shown
  onCopy={() => console.log("coupon copied")}
/>

Playground

Turn the props on the right; the snippet under them is what you would write to get what you see.

Usage
import { Button17 } from "@/components/beste/component/button17";

<Button17
  value="npx shadcn@latest init"
  prefix="$"
/>

Keyboard and gestures

Every one of these is in the component already. They are listed because a props table cannot mention a gesture, so nothing else on this page can tell you they exist.

ClickCopies the value and says so; the label goes back after `resetDelay`.

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
value*stringThe text written to the clipboard
labelstringDisplay text (defaults to value)
prefixstringMuted, non-copied prefix rendered before the label (e.g. "$" for shell commands)
resetDelaynumberHow long the copied state is shown, in ms
tone"neutral" | "dark"Surface tone: bordered background (default) or solid dark
onCopy() => voidCalled after a successful copy
classNamestringAdditional classes merged onto the button

More Button components

View all Button

Pressable Button

A neobrutalist button with a hard offset shadow that lifts on hover and presses in on click.

Avatar Stack Button

A social proof button with an avatar stack inside the pill and a trailing arrow.

Editorial CTA Button

An editorial pill button with a rolling label and animated icon seal on hover.

Shine Sweep Button

A premium pill button with a diagonal shine sweep on hover for pricing and upgrade actions.

Corner Brackets Button

A monospace button framed by corner brackets that spring outward on hover.

Scramble Button

A scramble text button that cycles random glyphs on hover for developer and tech landings.

Markdown version