FX · Interactions
A copy button whose icon morphs into a check.
npx shadcn@latest add https://www.rad-ui.com/r/copy-button.json
- The result is announced with a role="status" "Copied" message, not just shown.
- Needs an accessible name via `label`, e.g. "Copy install command".
- prefers-reduced-motion: reduce (or data-rad-fx-motion="reduce" on an ancestor) swaps the icons without animating.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Text to copy. |
label | string | 'Copy' | Accessible name. |
resetAfter | number | 1800 | Milliseconds before resetting. |