Copy
The EuiCopy component is a utility for copying text to clipboard. Wrap a function that returns a component. The first argument will be a
copy
function.Copy to clipboard function
The function copyToClipboard
allows you to copy text to the clipboard. It receives an argument of type string
.
Props
EuiCopy
Prop | Description and type | Default value |
---|---|---|
Prop textToCopy# | Description and type Text that will be copied to clipboard when copy function is executed. string | Default value Required |
Prop children# | Description and type Function that must return a component. First argument is 'copy' function. (copy: () => void) => ReactElement<any, string | JSXElementConstructor<any>> | Default value Required |
Prop beforeMessage# | Description and type Tooltip message displayed before copy function is called. ReactNode | Default value |
Prop afterMessage# | Description and type Tooltip message displayed after copy function is called that lets the user know that ReactNode | Default value Copied |
Prop className# | Description and type Type: string | Default value |
Prop aria-label# | Description and type Type: string | Default value |
Prop data-test-subj# | Description and type Type: string | Default value |
Prop css# | Description and type Type: Interpolation<Theme> | Default value |
Prop title# | Description and type An optional title for your tooltip. ReactNode | Default value |
Prop id# | Description and type Unless you provide one, this will be randomly generated. string | Default value |
Prop content# | Description and type The main content of your tooltip. ReactNode | Default value |
Prop position# | Description and type Suggested position. If there is not enough room for it this will be changed. ToolTipPositions | Default value |
Prop onMouseOut# | Description and type If supplied, called when mouse movement causes the tool tip to be (event: MouseEvent<HTMLSpanElement, MouseEvent>) => void | Default value |
Prop display# | Description and type Common display alternatives for the anchor wrapper "block" | "inlineBlock" | Default value |
Prop anchorProps# | Description and type Passes onto the span wrapping the trigger. CommonProps & HTMLAttributes<HTMLSpanElement> | Default value |
Prop repositionOnScroll# | Description and type When When nesting an boolean | Default value |
Prop anchorClassName# | Description and type Passes onto the span wrapping the trigger. string | Default value |
Prop delay# | Description and type Delay before showing tooltip. Good for repeatable items. ToolTipDelay | Default value |