Copy Button

A customizable copy-to-clipboard button with animated feedback and optional tooltip support.

Live Preview
Loading…

Installation

$ pnpm dlx shadcn@latest add https://themainakb.com/r/copy-button.json

Features

  • Animated Feedback — Smoothly transitions between copy and success states using Motion animations.
  • Optional Tooltip — Display a customizable tooltip with automatic "Copied!" feedback.
  • Highly Customizable — Customize labels, icon size, reset delay, styling, and copy callbacks.

Usage

import { CopyButton } from "@/components/copy-button";
<CopyButton value="This is copied"/>

Compatibility Note

Some components are currently built using shadcn/ui (Radix) primitives and may not work with shadcn/ui (Base UI) yet. I'm actively working on making every component compatible with both Radix and Base UI variants of shadcn/ui. Compatibility will continue to improve with future updates.