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.
iconClassNamestringAdditional 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

vue
<script setup>
import { KCopyButton } from '@kK-2004/ui-component'
</script>

<template>
  <KCopyButton
    value="https://example.com/api-key-123"
    tooltip="Copy API key"
    tooltip-placement="bottom"
  />
</template>