Copy Button

A button that copies text to the clipboard, with copy and copied states.

Installation

Copy the command below and run it in your terminal.

bunx @sivir/ui add copy-button

Usage

Import Copy Button and pass the text to copy:

import { CopyButton } from '$lib/sivir/components/copy-button';

<CopyButton text="bun add @sivir/ui" />
<CopyButton text={apiKey} label="Copy key" variant="outline" />

Examples

Copy Button in common compositions and contexts.

In a field

bunx @sivir/ui add copy-button

Variants