Copy Button
A copy-to-clipboard button whose icon pops into a hand-drawn check, with a ring pulse on success.
motionlucide-reactutils@soultel/use-copy-to-clipboard
npm i soultelInstallation
$ pnpm dlx shadcn@latest add @soultel/copy-buttonNo namespace set up? npx shadcn@latest add https://asafefe.dev/r/copy-button.json works too.
Manual installation
- 1. Install the dependencies.
terminal1 lines npm install motion lucide-react - 2. Copy the source from the Code tab into components/copy-button.tsx.
Usage
import { CopyButton } from "@/components/copy-button"
export function Example() {
return <CopyButton value="npm i soultel" />
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | - | Text written to the clipboard. |
