Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsUtilitiesPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Accessibility
  • Auto sizer
  • Color palettes
  • Copy
  • CSS utility classes
  • Delay
  • Error boundary
  • Focus trap
  • Highlight and mark
  • HTML ID generator
  • I18n
  • Inner text
  • Mutation observer
  • Outside click detector
  • Overlay mask
  • Portal
  • Pretty duration
  • Provider
  • Resize observer
  • Scroll
  • Text diff
  • Text truncation
  • Window events
  • EUI
  • Copy

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.

Loading...

Copy to clipboard function

The function copyToClipboard allows you to copy text to the clipboard. It receives an argument of type string.

Loading...

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.

Type: string
↦
Default value
Required
↵
Prop
children#
↦
Description and type

Function that must return a component. First argument is 'copy' function.
Use your own logic to create the component that users interact with when triggering copy.

Type: (copy: () => void) => ReactElement<any, string | JSXElementConstructor<any>>
↦
Default value
Required
↵
Prop
beforeMessage#
↦
Description and type

Tooltip message displayed before copy function is called.

Type: ReactNode
↦
Default value
↵
Prop
afterMessage#
↦
Description and type

Tooltip message displayed after copy function is called that lets the user know that
'textToCopy' has been copied to the clipboard.

Type: ReactNode
↦
Default value
Copied
↵
Prop
tooltipProps#
↦
Description and type

Optional props to pass to the EuiToolTip component.

Type: Partial<Omit<EuiToolTipProps, "children" | "content" | "onMouseOut">>
↦
Default value
↵
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
↵
𐘂𐘂
Edit this page

Previous
Color palettes
Next
CSS utility classes
  • Copy to clipboard function
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic