# CopyButton Documentation ## Installation ```bash jsrepo add ui/copy-button ``` ## Components ### CopyButton A button that copies text to the clipboard and shows feedback. #### Props | Prop | Type | Default Value | Required | Bindable | Description | |------|------|--------------|----------|----------|-------------| | ref | HTMLButtonElement | null | false | true | A reference to the underlying button element. | | children | Snippet | - | false | false | Slot content for the copy button (e.g., custom label or icon). | | text | string | - | true | false | The text to copy to the clipboard. | | icon | Snippet | - | false | false | Custom icon to display in the button. | | animationDuration | number | - | false | false | Duration of the copy animation in ms. | | variant | "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | ghost | false | false | The visual style of the button. | | size | "default" | "sm" | "lg" | "icon" | icon | false | false | The size of the button. | | onCopy | (status: "success" | "failure") => void | - | false | false | Callback when copy is triggered. Receives status: "success" | "failure". |