A copy button component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
childrenJSX.Element | null

React element children.

copyTextstring

The text to copy to the clipboard when the button is clicked.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

disabledboolean

Whether the button is disabled or not.

iconstring

Icon name if using an icon button.

iconAttributesobject

Custom attributes for the icon.

iconPrefixstring

The prefix for the icon library to be used.

iconSizenumber

The icon size, in px, when type is flexible.

labelstring

The button label.

onClickfunction

On click handler for the button.

sizestring

The button size.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

typestring

The button type.

Since
  • 5.6.0
Returns:

The copy button component.

Type: 
JSX.Element
Example
import CopyButton from '@gravityforms/components/react/admin/elements/Button/CopyButton';

return (
    <CopyButton onClick={ () => {} } type="white" label={ 'Click me' } />
);