Copy Button
A copy-to-clipboard button with blur transition effect.
Installation
One-time setup: add the @ikui registry to your components.json.
components.json
{
"registries": {
"@ikui": "https://ik-ui.pages.dev/r/{name}.json"
}
}Then install the component:
pnpm dlx shadcn@latest add @ikui/copy-buttonUsage
import { CopyButton } from "@/components/copy-button";<CopyButton value="Text to copy" />Examples
Size
With label
Props
| Prop | Type | Default |
|---|---|---|
value | string | (() => string | Promise<string>) | - |
size | SizeVariant | default |
timeout | number | 1500 |
copyIcon | ReactNode | - |
copiedIcon | ReactNode | - |
onCopy | (value: string) => void | - |
onCopyError | (error: unknown) => void | - |
children | ReactNode | - |
copiedChildren | ReactNode | - |
className | string | - |