Edit page

CopyToClipboard

A component that allows you to easily make snippets of text selectable and add it to your clipboard for pasting in another location.

Import Syntax

Basic Usage

Custom Components

Props

PropertyTypeRequiredDefaultDescription
tooltipStringfalseCopyThe tooltip label before the text is copied.
successTooltipStringfalseCopied!The tooltip label after the text is copied.
appendToBodyBoolfalsetrueThe tooltip will use appendToBody for positioning on the dom
copyIconNodefalse<CopyToClipboardIcon />Icon to be used in the copy to clipboard button
copySuccessIconNodefalse<CheckIcon />Icon to be used once the copy to clipboard button has been clicked
childrenNodefalse-Text to be copied.
copyValueStringfalse-If you're using components as children of this component you must provide a string value to be copied to the clipboard when clicked
positionFixedBoolfalse-The tooltip will use position: fixed
tooltipStyleObjectfalse-Style definition passed to the tooltip popover
tooltipTargetWrapperStyleObjectfalse-Style definition passed to the tooltip target wrapper