JB logo

Command Palette

Search for a command to run...

yOUTUBE
Components
PreviousNext

Copy Button

Copy text to clipboard with visual feedback and animation.

Loading...

Installation

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

Usage

import { CopyButton } from "@/components/copy-button";
<CopyButton text="Text to copy" />

Props

PropTypeDefaultDescription
textstring | (() => string)-The text to copy.
onCopySuccess(text: string) => void-Called with the copied text on success.
onCopyError(error: Error) => void-Called with the error if copy fails.
idleIconReact.ReactNodeCopyIconCustom icon for idle state.
doneIconReact.ReactNodeCheckIconCustom icon for done state.
errorIconReact.ReactNodeCircleXIconCustom icon for error state.