Clipboard

May 18, 2026 ยท View on GitHub

License Stable Downloads Vue JavaScript SCSS npm Issues Merge Requests

Description

Hidden clipboard helper component for Enso UI.

Installation

Install the package:

yarn add @enso-ui/clipboard

This package is also available through the full enso-ui workspace bundle.

Features

  • exports a minimal hidden input that centralizes copy-to-clipboard behaviour
  • supports iOS-specific selection logic before issuing document.execCommand("copy")
  • keeps the clipboard element off-screen and non-interactive

Usage

<script setup>
import { ref } from 'vue';
import Clipboard from '@enso-ui/clipboard';

const clipboard = ref(null);

const copy = value => clipboard.value.copy(value);
</script>

<Clipboard ref="clipboard" />

API

Clipboard

Default export that exposes imperative clipboard-copy helpers through a component ref.

Import: @enso-ui/clipboard

Props:

  • maxLength: number = 99999 selection length used by the iOS fallback.

Methods:

  • copy(value)
  • select()

Depends On

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

License

MIT