A copy button component with a variety of styles and animations.
Made by imskyleenInstallation
Usage
API Reference
CopyButton
contentstring—The content of the button.
copied?boolean—The copied state of the button.
onCopiedChange?(copied: boolean, content?: string) => void—The callback function when the copied state changes.
delay?number3000The delay in milliseconds before the copied state resets.
variant?"default" | "accent" | "destructive" | "outline" | "secondary" | "ghost" | "link"defaultThe variant of the button.
size?"default" | "sm" | "lg" | "icon"defaultThe size of the button.
hoverScale?number1.05The scale of the button on hover.
tapScale?number0.95The scale of the button on tap.
...props?HTMLMotionProps<"button">—The props for the button.
Credits
- Credit to shadcn/ui for style inspiration.