Skip to content

Copy Text ​

The ue-copy-text component renders a clipboard icon that copies a value to the clipboard on click. A "Copied!" tooltip is shown for 2 seconds after a successful copy.

Usage ​

html
<ue-copy-text :text="item.api_key" />

Props ​

PropTypeDefaultDescription
textString|NumberrequiredThe value written to the clipboard
iconString'mdi-content-copy'MDI icon name for the trigger
colorString'primary'Icon color
sizeString'small'Icon size (x-small, small, default, large, x-large)

Examples ​

html
<!-- Copy an API key -->
<div class="d-flex align-center ga-2">
  <span class="text-caption font-weight-mono">{{ item.api_key }}</span>
  <ue-copy-text :text="item.api_key" />
</div>

<!-- Custom icon and color -->
<ue-copy-text :text="shareUrl" icon="mdi-share-variant" color="secondary" size="default" />

Clipboard Access

Internally uses this.$copy(), which wraps the Clipboard API. Copy only works in secure contexts (HTTPS or localhost).