Components › Actions

Copy button

Copies a value and confirms with a check for a moment.

Installation

npx plankui@latest add copy-button

Usage

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

<CopyButton value={apiKey} />
<CopyButton value={link} label="Copy link" />

API reference

PropTypeDefaultDescription
valuestringrequiredText to copy.
labelstringText beside the icon; icon-only when omitted.
onCopied() => voidCalled after copying.

View the source on GitHub