Copy text to clipboard with visual, haptic, and audio feedback.
Features
- Animated icon transitions across idle, success, and error states.
- Haptic feedback confirms copy success on supported devices.
- UI sounds play distinct success and error cues.
- Accepts a string or function for dynamic content.
- Callback support for success and error events.
Installation
$ pnpm dlx shadcn@latest add @ncdai/copy-button
Usage
import { CopyButton } from "@/components/copy-button"<CopyButton text="Some text to copy" />API Reference
CopyButton
Extends Button with clipboard functionality.
Prop
Type
See shadcn/ui documentation for more information.