CopyToClipboard

A button to copy content to the user's clipboard.

Internal Component

This component is intended solely for use within GitHub and is not available for external use.

Props

CopyToClipboard

No props documented

CopyToClipboardButton

NameDefaultDescription
onCopy
() => void

Optional callback that is invoked after copying is initiated.

textToCopy Required
string

Text that will be copied to the clipboard.

CopyToClipboardIconButton

NameDefaultDescription
icon
CopyIcon
Icon

Octicon that is displayed on the copy button

size
"small" | "medium" | "large"

Size of the button, passed to IconButton

onCopy
() => void

Optional callback that is invoked when the user clicks the copy button

textToCopy Required
string

Text that will be copied to the clipboard

tooltipProps
Omit<TooltipProps, "aria-label" | "text" | "type" | "id" | "aria-hidden">

Props that will be applied to tooltips

variant
"invisible"
any

Which icon button variant to use

ariaLabel
`Copy "${textToCopy}" to clipboard`
string

Text that will be displayed in the tooltip