CopyButton
Button that copies text to clipboard with a timed success feedback animation.
Installation
Examples
Inline code snippet
Copy button alongside a code string.
npm install veloria-uiSuccess state
After copying, shows a check and success message.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| text* | string | required | Text to copy to clipboard. |
| timeout | number | 2000 | How long the success state shows in ms. |
| onCopied | () => void | — | Called after successful copy. |
| size | 'sm'|'md'|'lg' | 'md' | Controls button size. |
| variant | 'icon'|'button' | 'icon' | Display as icon-only or labelled button. |