ClipboardButton

관리자:
Raubzeug
GitHub
size
text
hasTooltip
timeout
tooltipInitialText
tooltipSuccessText

ClipboardButton is a ready-made button that copies given text to the clipboard and plays a success animation. It combines CopyToClipboard (the copy behavior) with ClipboardIcon (the animated icon).

import {ClipboardButton} from '@gravity-ui/uikit';

Properties

The ClipboardButton properties are inherited from the Button properties.

NameDescriptionTypeDefault
hasTooltipToggles displaying the tooltipbooleantrue
onCopyCallback after copying (text: string, result: boolean) => voidFunction
textText to copy (can be a string or a function that returns a string)string | () => string
timeoutTime before the state switches back to normal after the button is clickednumber1000
tooltipInitialTextText shown before copyingstring"Copy"
tooltipSuccessTextText shown after copyingstring"Copied!"
iconCustom iconReact.ReactNode
iconPositionPosition of iconstart | endstart