npx shadcn@latest add @synccn/buttonsync_demo_7Q••••••••Installation
$ pnpm dlx shadcn@latest add @synccn/copy-buttonFirst time in this project? Connect synccn with one command.
Usage
import { CopyButton } from "@/components/ui/copy-button";<CopyButton value="npx shadcn@latest add @synccn/button" />API reference
Generated from the component's TypeScript types, so it always matches the code.
CopyButton
Copies `value` and swaps to a check mark for a moment.
PropTypeDescription
- valuerequired
string | (() => string)Text to copy, or a function that returns it.
- label
stringDefault
"Copy"Accessible label before copying.
- onCopied
() => voidCalled after a successful copy.
- className
stringExtra classes for the root element.
- children
React.ReactNodeContent to render.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/clipboardcopyText (copies to the clipboard)
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for Check, Copy
Used by
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-label
- Shows a visible focus ring for keyboard users
More display
CardSurface with header, content and footer slots.BadgeSmall status label with an optional dot.AvatarImage with initials fallback, presence dot and stacked groups.KbdKeyboard key for shortcuts and hints.SeparatorHorizontal, vertical or labelled divider.AccordionExpanding sections with smooth height animation.