Spelte

Command Palette
Search for a command to run...

Copy Button

A copy-to-clipboard button with blur transition effect.

Installation

pnpm dlx shadcn-svelte@latest add https://spelte.dev/r/copy-button.json

Usage

<script>
  import CopyButton from '$registry/spelte/copy-button.svelte';
</script>
 
<CopyButton value="Text to copy" />

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | — | Text to copy to clipboard | | size | "sm" | "default" | "lg" | "default" | Button size | | class | string | — | Additional CSS classes | | onclick | (e: MouseEvent) => void | — | Click event handler |