Copy Button
Copies a value to the clipboard on click and briefly shows a checkmark confirmation. Use inside code blocks, beside token values, or anywhere text needs to be easily copied.
Examples
With label
Variants
In a code block
npm install @haydywoo/dave-reactProps
value*
string
Text written to the clipboard on click.
variant= 'ghost'
'ghost' | 'outline' | 'solid'
Visual style.
size= 'md'
'sm' | 'md' | 'lg'
Button size.
label
string
Optional text label rendered beside the icon. When set, shows "Copied" on success.
resetDelay= 2000
number
Milliseconds before reverting from the copied state.
className
string
Additional classes.
| Prop | Type | Default | Description |
|---|---|---|---|
| value* | string | — | Text written to the clipboard on click. |
| variant | 'ghost' | 'outline' | 'solid' | 'ghost' | Visual style. |
| size | 'sm' | 'md' | 'lg' | 'md' | Button size. |
| label | string | — | Optional text label rendered beside the icon. When set, shows "Copied" on success. |
| resetDelay | number | 2000 | Milliseconds before reverting from the copied state. |
| className | string | — | Additional classes. |