CopyButton
Copy a value: a read-only pill field, a copy circle, or inline text that copies itself.
import { CopyButton } from "@logicplanes/kaeso-ui";Props
childrenReactNodeWhat a field or inline text shows, when it differs from the copied text, such as a redacted form; the value is still what is copied.
display"inline" | "icon" | "field" = iconA circle (
icon), a read-only pill field (field), or mono text inside a sentence or a row (inline).labelstringWhat is being copied, for the accessible name and the tooltip: "Copy key". Defaults to "Copy" in the provider's language.
onCopy((value: string) => void)Called with the copied text.
size"md" | "xs" | "sm" | "lg" | "xl" = smThe circle's height, or a field's: 32px (
sm) by default.valuestringThe text that is copied.
variant"secondary" | "ghost" | "quiet" = ghostA filled circle (
secondary), a ghost (ghost), or a ghost in secondary text until hovered (quiet).