Copy button

A raised button that copies text to the clipboard. The icon flips to a tick and screen readers are told it worked. Has a fallback when the Clipboard API is blocked.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

CopyButton3D props

PropTypeDefaultDescription
textstringThe text that is copied.
childrenReactNodeVisible label. Leave it out for an icon-only button.
copiedLabelReactNode"Copied"Label shown after copying. Only used when children is set.
resetAfternumber1800How long the copied state stays, in milliseconds.
onCopy(text: string) => voidCalled after the text was copied.
aria-labelstring"Copy"Accessible name when there is no visible label.
classNamestringExtra classes added to the button.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks