Clipboard
Copy-to-clipboard trigger with transient success feedback shown after copying.
Examples
Basic copy
Copy a short value to the clipboard with one click.
With feedback
Input + copy button showing a success message after copy.
Code block copy
Floating copy button overlaid on a code block.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { Clipboard } from "@rokle/components";import { Clipboard } from "@rokle/components";
export function Example() {
return <Clipboard />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | - | Text to copy to the clipboard. |
| timeout | number | 2000 | Duration in ms to show the copied state. |