GitHub

Clipboard

A component to copy text to the clipboard.

Installation

Usage

Examples

Icon Only

Different Icons

Use the copied prop on <ClipboardIndicator /> to customize the icon shown when copied.

Add a children to the <ClipboardIndicator /> to customize the icon shown when not copied.

Custom Timeout

Use the timeout prop on <Clipboard /> to customize how long the copied state is shown.

Controlled

Use the onStatusChange prop to control the clipboard value programmatically.

Value Text

Use <ClipboardValueText /> to display the value as text instead of an input field.

https://x.com/vinihvc

API Reference

Clipboard

Root element of the clipboard. Renders a div

ClipboardTrigger

Button that triggers the copy action. Renders a button

ClipboardInput

Input field that displays the value. Renders an input

ClipboardIndicator

Indicator that shows different icons based on the copied state. Renders a span

ClipboardValueText

Text element that displays the value. Renders a span


For a complete list of props, see the Ark UI documentation.