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.
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | The text that is copied. | |
| children | ReactNode | Visible label. Leave it out for an icon-only button. | |
| copiedLabel | ReactNode | "Copied" | Label shown after copying. Only used when children is set. |
| resetAfter | number | 1800 | How long the copied state stays, in milliseconds. |
| onCopy | (text: string) => void | Called after the text was copied. | |
| aria-label | string | "Copy" | Accessible name when there is no visible label. |
| className | string | Extra classes added to the button. |