Skip to main content

Variable: CopyButton

@arolariu/components


@arolariu/components / CopyButton

Variable: CopyButton

const CopyButton: ForwardRefExoticComponent<CopyButtonProps & RefAttributes<HTMLButtonElement>>

Defined in: components/ui/copy-button.tsx:46

A compact icon button that copies text to the clipboard.

Remarks

Rendering Context: Client component.

Uses navigator.clipboard.writeText when available and swaps from a copy icon to a confirmation icon for a configurable duration after a successful copy. If clipboard access fails, the button remains interactive without throwing to the UI.

Example

<CopyButton value="npm install @arolariu/components" />

See

MDN Clipboard.writeText

// was this page useful?