hiip/ui

Components / Controls

Copy Button

Copy to clipboard: tick for a beat, toast, and a message when it fails.

Install — needs @hiip registered in components.json

bunx shadcn@latest add @hiip/copy-button

Or by URL, with the token in the query

bunx shadcn@latest add "https://ui.hiip.ai/r/copy-button.json?token=$HIIP_REGISTRY_TOKEN"

Both need a token — set one up.

Anatomy

Import from components/ui/hiip-ui/copy-button.

<CopyButton />

Examples

API Reference

Generated from the source. Props forwarded to the underlying element are not listed.

CopyButton

PropTypeDefault
valuerequiredstring
ariaLabel

The accessible name when there is no visible `label` — an icon-only button otherwise reaches a screen reader as "button" and nothing else.

string | undefined
classNamestring | undefined
labelstring | undefined
nativeButtonboolean | undefined
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState> | undefined
sizeany
variantany
Type
registry:ui
Pulls in
button, sonnershadcn installs these for you if they are missing.
npm packages
@base-ui/react sonner @hugeicons/react @hugeicons/core-free-icons
Files written
  • components/ui/hiip-ui/copy-button.tsx