ClipboardCopy
ready
This page may be removed. Primer plans to move all Rails component documentation to Lookbook.
Description
Use ClipboardCopy to copy element text content or input values to the clipboard.
This component by itself is not styled as a button, and can therefore only be used in limited circumstances.
If you're looking for a button, consider using Primer::Beta::ClipboardCopyButton
instead.
Accessibility
Always set an accessible label to help the user interact with the component.
This component has a built-in aria-live region that announces "Copied!" when the copy element is pressed.
Arguments
| Name | Default | Description |
|---|---|---|
aria-label | StringString that will be read to screenreaders when the component is focused | |
value | StringText to copy into the users clipboard when they click the component. | |
for | StringElement id from where to get the copied value. | |
system_arguments | Hash |