Components/CopyButton

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

Success state

After copying, shows a check and success message.

API Reference

PropTypeDefaultDescription
text*stringrequiredText to copy to clipboard.
timeoutnumber2000How long the success state shows in ms.
onCopied() => voidCalled after successful copy.
size'sm'|'md'|'lg''md'Controls button size.
variant'icon'|'button''icon'Display as icon-only or labelled button.