Reusable component for copying text values to the clipboard with visual feedback
CopyToClipboard Component
A reusable component for copying text values to the clipboard with visual feedback.
Add this component
The command below includes <strong>Copy to Clipboard</strong>—run it in your project directory to install this component (and the CSS if needed). No prompts.
Choose your package manager — click a tab to select, then copy the command.
npm pnpm yarn bun
bashbash
npx rizzo-css add CopyToClipboard
bashbash
pnpm dlx rizzo-css add CopyToClipboard
bashbash
npx rizzo-css add CopyToClipboard
bashbash
bunx rizzo-css add CopyToClipboard
Live Example
Click the button below to copy text:
Usage
Usage
Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tab—both stay in sync.
<!-- Ensure Rizzo CSS and js/main.js are loaded. Buttons with data-copy-value or [data-copy] work automatically. -->
<button type="button" class="copy-trigger" data-copy value="example@email.com" aria-label="Copy">
<span class="copy-trigger__text">Copy</span>
</button>