Docs
Copy Button
A button component that copies content to clipboard with visual feedback.
The CopyButton component provides a simple way to copy text to the clipboard with visual feedback using a check mark animation when successful.
Installation
pnpm dlx shadcn@latest add https://devkit.kiron.dev/k/copy-button
Usage
import { CopyButton } from "@/components/ui/copy-button"
export function Demo() {
return (
<CopyButton
content="Text to be copied"
copyMessage="Copied to clipboard!"
/>
)
}Examples
Basic Usage
With Custom Success Message
Within a Code Block
console.log("Hello World")Props
| Prop | Type | Description |
|---|---|---|
content | string | The text content to be copied to clipboard |
copyMessage? | string | Optional custom message to show when content is copied |