useCopyToClipboard

Handle copy interactions, copied state, and timeout reset in a single helper.

Preview

Clipboard interaction

This mirrors the common UI pattern where the copy action updates local feedback state for a short period.

Registry install

pnpm dlx shadcn@latest add @tile-ui/use-copy-to-clipboard

Usage

const { copy, copied } = useCopyToClipboard();