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-react

Props

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.