Skip to content

KCopyButton ​

示例 ​

Click to copy

Hello World

With custom tooltip

secret-key-123

A button that copies a string value to the clipboard, with optional tooltip feedback.

Props ​

NameTypeDefaultDescription
valuestring— (required)The text value to copy to the clipboard.
tooltipstring'Copy'Tooltip text shown before copying.
successTooltipstring'Copied!'Tooltip text shown after a successful copy.
tooltipPlacement'top' | 'bottom' | 'left' | 'right''top'Placement of the tooltip relative to the copy button.
variant'ghost' | 'outline' | 'default' | 'secondary' | 'destructive''ghost'Button variant style.
size'default' | 'sm' | 'lg' | 'icon' | 'icon-sm''icon-sm'Button size.
iconClassNamestring—Additional CSS classes applied to the copy icon.

Emits ​

NameParametersDescription
——This component does not emit custom events.

Slots ​

NameDescription
—This component does not provide slots.

Basic Usage ​