Loading preview
Like Button
ButtonsA heart toggle that pops and bursts when liked, with an optional count.
Copies text to the clipboard and confirms with a check mark and a screen reader message.
npx shadcn@latest add @venusui/copy-buttonRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/copy-button.tsxThe code behind the preview above.
copy-button-demo.tsx
import { CopyButton } from "@/components/ui/copy-button"
export default function CopyButtonDemo() {
return (
<div className="flex items-center gap-3">
<code className="rounded-md border bg-muted/50 px-3 py-1.5 font-mono text-sm">npm install motion</code>
<CopyButton value="npm install motion" aria-label="Copy install command" />
<CopyButton value="npm install motion">Copy</CopyButton>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | — | Text to copy. Required. |
| timeout | number | 2000 | Milliseconds the copied state is shown. |
| onCopy | (value: string) => void | — | Called after a successful copy. |
All <button> props except value. Give icon-only buttons an aria-label.
lucide-react for icons, React 19 and Tailwind CSS v4.<CopyButton value={x}>Copy</CopyButton>), or none for an icon button.data-[state=copied]: classes, e.g. a green border.aria-label, e.g. “Copy install command”.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A heart toggle that pops and bursts when liked, with an optional count.
A hanging lamp you switch by pulling its cord; it can toggle the page between light and dark mode.
Cards arranged in a ring that turns in 3D, with buttons, arrow keys and announcements.