Copies a value a person needs somewhere else, such as a link, an id, a key or a command, and answers in place whether it worked.
Examples
A booking number and its copy button as one chip; the glyph turns to a check once it is copied.
BookingBK-4821
After a copyPressing either button turns its glyph to a check and its tooltip to Copied for 1.5 seconds, and reads Copied once; the other stays as it was.
Fund id
F-0001234567
Webhook
https://example.com/hooks/filings/7f3a2c
When the clipboard refusesWhen the clipboard refuses, the glyph stays and the tooltip opens with Could not copy for 3 seconds, so the value can be selected by hand.
Door codeGARDEN-4821
In a fieldA command in a read-only field, with its copy button inside the field's end.
Run it in your project; it adds the component and its tokens.
Variants
SecondaryA labelled button, or an icon button that needs a fill beside a field.
Usage
Use it when
A value is meant to be pasted elsewhere: a share link, a booking number, an API key's id, a command.
A code block or a read-only field holds text a person will copy.
Use something else when
The person shares a link through the device's own share sheet. Use Button instead, with navigator.share and this as the fallback.
The text is long and meant to be read, such as a paragraph. Use Textarea instead, read-only, so it can be selected.