Preview
CopyButton requires the Clipboard API and client feedback after activation. This server-rendered page does not imitate client behavior. Open the live playground.
Usage
CopyButton usage<CopyButton text={sha} label="Copy commit" />API
CopyButton APICopyButtonProps
Copy-to-clipboard button. Island doctrine (clipboard needs the client runtime); on success the glyph flips to a check for a moment and a toast fires if the page mounts a Toaster (the kp:toast event is harmless without one). Clipboard requires a secure context — failures surface as a fail toast, never silently.
| prop | type | notes |
|---|---|---|
| text | string | The text that lands on the clipboard. |
| label? | string | Accessible/visible label (default "Copy"). |
| announce? | string | Toast message on success (default "Copied."). |
| glyphOnly? | boolean | Show only the glyph (label stays for AT). |
| variant? | BtnVariant | |
| size? | BtnSize | |
| mix? | MixInput |