Copy buttondata-display
Button that copies a value to the clipboard with idle, copied and failed states, icon swap and a live announcement.
설치
pnpm
pnpm dlx shadcn@4.23.0 add @uikit/copy-buttonDefault
copy-button-demo.tsx
import { CopyButton } from "@/components/ui/copy-button";
export default function CopyButtonDemo() { return ( <div className="flex items-center gap-2"> <code className="rounded-md bg-muted px-2 py-1 text-sm">RSV-20260301-0042</code> <CopyButton value="RSV-20260301-0042" /> </div> );}