CopyToClipboardButton
A button that copies text to the clipboard when clicked.
Internal Component
This component is intended solely for use within GitHub and is not available for external use.React
draft
Props
CopyToClipboardButton
| Name | Default | Description |
|---|---|---|
icon | CopyIcon | IconOcticon that is displayed on the copy button |
size | 'small' | 'medium' | 'large'Size of the button, passed to IconButton | |
onCopy | () => voidOptional callback that is invoked when the user clicks the copy button | |
textToCopy Required | stringText that will be copied to the clipboard | |
tooltipProps | Omit<TooltipProps & SxProp, 'text' | 'aria-label' | 'type' | 'id' | 'aria-hidden'>Props that will be applied to tooltips | |
variant | invisible | VariantTypeWhich icon button variant to use |
ariaLabel | Copy "${textToCopy}" to clipboard | stringText that will be displayed in the tooltip |