Pho Design System

Copy Button

The one copy affordance: a quiet icon button that writes value to the clipboard, swaps its glyph to a check for a moment, and says Copied to assistive tech through a polite live region. Ghost at rest so a mono value stays the loudest thing on its line. LogList, DescriptionList, and CodeBlock use it; put it after any id or key a user will paste somewhere.

pho_prj_01kztbv929fagsn0pk422y682f

Import

import { CopyButton } from "@photon-ai/pho-ui/components/copy-button";

Sizes

Three square sizes: xs (14px icon, 24px hover wash that overflows the line) inline after a value, sm (28px, the default) in a row cell or a panel header, md (32px) in a toolbar.

<CopyButton value={project.id} label="project id" size="xs" />

Props

The state behind it is useCopy() from @photon-ai/pho-ui/utils: copy(text) resolves to whether the write landed, and copied holds for COPY_FEEDBACK_MS (1.5 s) so a control of your own can swap its glyph.

Accessibility

Best practices