vue3-copy

This is fork from egoist/v-copy and now support Vue 3.
1,158 1
Install
npm install vue3-copy
Latest Version:1.0.1
Vue:3
License:MIT
Last Updated:Oct 18, 2026
Links: GitHub  ·  npm
Maintainer: mollykannn

vue3-copy

This is fork from egoist/v-copy and now support Vue 3.

Vue directive to copy to clipboard.

Install

yarn add vue3-copy

Usage

First register the directive globally:

import Copy from "vue3-copy";

const app = createApp(App);
app.use(Copy);
app.mount("#app");

Then use it in template:

<template>
  <button v-copy="`some text`">Copy!</button>
</template>

v-copy:callback: executed after text is copied to clipboard.

<template>
  <button v-copy="`some text`" v-copy:callback="handleCopied">Copy!</button>
</template>

<script>
export default {
  setup() {
    function handleCopied(text = "") {
      alert(`Copied: ${text}`)
    }
    return {
      handleCopied
    }
  }
}
</script>

Browser support

This supports what copy-text-to-clipboard supports, namely ever-green browsers and IE9+. (Not all are carefully tested though :P)

License

MIT © EGOIST

Related Packages

v-clipboard

Vue.js Clipboard Plugin

1,101,981 515
@scalar/use-clipboard

tiny wrapper around the clipboard API

37,211 16,304
@meforma/vue-copy-to-clipboard

Vue.js 3 plugin to copy text to clipboard

16,239 12
@mooth/copy

copy text to clipboard from native select element

0
nuxt-clipboard

A "copy to clipboard" module for Nuxt.js using vue-clipboard2

60,155 14

Version History

Version Released Vue License
1.0.1 ^3.2.16 MIT
1.0.0 ^3.2.16 MIT