Skip to content

CopyButton

A borderless copy-to-clipboard icon button. The glyph flips to a check for 1.5s on success and reports a rejected copy through its label, so a silent no-op is never mistaken for a successful copy.

Source

import { CopyButton } from "@flanksource/clicky-ui/components";
Default · Open in Storybook
Lazy Value · Open in Storybook
Copies · Open in Storybook

The props table documents the component-specific surface. Standard DOM attributes inherited from React, such as className, event handlers, and accessibility attributes, may also be accepted when the component’s prop type extends a native element.

Prop Type Default Description
className string — Extra classes for the button.
iconClassName string — Extra classes for the glyph.
label string Copy Accessible name; drives both aria-label and the tooltip.
value* (…) => … — Text to copy, or a thunk producing it. Use the thunk form when the payload is expensive to build and only needed on click.