Skip to content

Copy

A component that copies text to the clipboard when clicked. Supports toast feedback and imperative invocation.

Basic Usage

vue
<template>
  <see-copy text="Hello, World!">
    <button>Click to copy</button>
  </see-copy>
</template>

Imperative Usage

ts
import { useCopy } from 'see-u-ui'

const copy = useCopy()

await copy('Text to copy')

Props

PropTypeDefaultDescription
textstring''Text to copy to clipboard
isShowToastbooleantrueWhether to show success toast
toastMessagestring'Copied'Custom toast message
isDisabledbooleanfalseWhether the copy action is disabled
isHighlightbooleanfalseWhether to highlight the text when copied

Events

EventParametersDescription
onSuccess-Triggered when text is copied successfully
onError(error: Error)Triggered when copy fails
onClick-Triggered when the component is clicked

Liao ICP No. 2025070134