Back to blocks
npx shadcn@latest add https://ui.doras.to/r/clipboard.json

API Reference

Root

Contains all root functionality.

PropTypeDefault
textToCopy*string-
childrenReact.ReactNode-
classNamestring-
iconSizenumber16
copiedDurationnumber1500
tooltipTextstring"Click to copy"
tooltipCopiedTextstring"Copied!"
showTooltipbooleantrue
copyIconReact.ReactNode<Copy />
checkIconReact.ReactNode<Check />
checkIconClassNamestring-
copyIconClassNamestring-
onCopy() => void-
onError(error: Error) => void-
tooltipDelayDurationnumber0
disabledbooleanfalse

Examples

Custom button

You can use your own button as a child component for more control and styling abilities

Simple

The raw component