Skip to content
Buttons

Copy Button

Copy text to the clipboard with success feedback.

Import

tsx
import { CopyButton } from "@cooud-ui/ui";
bash
npx cooud-ui add copy-button

Examples

API Reference

Generated from the component's exported types.

CopyButtonProps

Extends Omit<ButtonProps, "value" | "children">

PropTypeDefaultDescription
value*
stringText written to the clipboard when the button is pressed.
timeout
number1500Milliseconds the "copied" state stays visible before reverting. Defaults to 1500.
copyLabel
string"Copy"Accessible label shown to assistive tech in the idle state. Defaults to "Copy".
copiedLabel
string"Copied"Accessible label announced after a successful copy. Defaults to "Copied".