Copy button
A copy-to-clipboard button that confirms with a glyph swap and a self-drawing check.
API reference
Components
<CopyButton />
Copy-to-clipboard button with confirm swap and aria-live announcement.
value
Text written to the clipboard on click.
variant?
Button shape. Defaults to "label".
children?
Visible resting label ("label" variant only). Default "Copy".
copiedText?
Visible confirmed label ("label" variant only). Default "Copied".
label?
Accessible name while resting. Default "Copy to clipboard".
copiedLabel?
Accessible name after copy. Default "Copied to clipboard".
resetMs?
How long the confirmed state holds, in ms. Default 2000.
onCopy?
Fired after the clipboard write is attempted.
disabled?
Disable the button.
className?
Merged onto the button element.
ref?
Ref to the underlying <button>.
Featured in
See the copy button composed into full sections.


