Actions
CopyButton <pm-copy-button>
Copies text to the clipboard and confirms it (visually and to screen readers).
Variants
Set with the variant attribute.
variant="solid"variant="soft"variant="outline"variant="ghost"Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="xs"size="sm"size="md"size="lg"Tones
Set tone on the element, or data-tone on any ancestor to tone a whole area.
tone="accent"tone="secondary"tone="neutral"tone="success"tone="warning"tone="danger"tone="info"States
Each state is one attribute.
DisabledAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | string | — | Text to copy. |
for | string | — | id of an element whose text (or value) is copied instead. |
label | string | Copy | Accessible name (and visible label where the component shows one). |
copied-labelprop: copiedLabel | string | Copied | Text shown (and announced) after copying. |
variant | 'solid' | 'soft' | 'outline' | 'ghost' | — | Visual style. |
size | 'xs' | 'sm' | 'md' | 'lg' | — | Size: xs, sm, md or lg (md when not set). |
show-labelprop: showLabel | boolean | false | Show the text label next to the icon. |
disabled | boolean | — | Not interactive. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-copy | onPmCopy | After a successful copy. |
pm-error | onPmError | Clipboard unavailable or denied. |
Methods
copy()
Used in templates
Customer 360User profileArticleComing soonServer error (500)