Button Copy

Icon button that copies text to the clipboard. Cross-fades to a check icon when copied with a tippy tooltip.

Default

Pass the string to copy via the text prop.

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import { ButtonCopy } from "@/components/ui/button-copy";

Next to an input

Common pattern: read-only input plus copy button for shareable URLs.

Dark previewReplay previewOpen in new tab

API Reference

ButtonCopy

PropTypeDefaultDescription
textstring—String written to the clipboard on click.