A highly configurable button component.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
activeboolean

Whether the button is active or not.

activeTextstring

The active text when the button is active.

activeTypestring

The active type, currently supports loader.

ariaLabelstring

The aria-label text for the button.

childrenJSX.Element | null

React element children.

circularboolean

Whether the button is a circular shape or not.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

disabledboolean

Whether the button is disabled or not.

disableWhileActiveboolean

Whether to disable the button while active.

iconstring

Icon name if using an icon button.

iconAttributesobject

Custom attributes for the icon.

iconPositionstring

Icon position if using one, leading or trailing.

iconPrefixstring

The prefix for the icon library to be used.

labelstring

The label for the button, or the text displayed when inactive.

loaderPropsobject

All valid options for the loader component if loader button is active.

lockSizeboolean

If interactive, whether to lock the width of the button when transitioning states.

onClickfunction

On click handler for the button.

sizestring

Size of the button.

spacingstring | number | Array | object

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

typestring

The button type.

widthstring

The button width, auto or full.

refobject | null

Ref to the component.

Since
  • 1.1.15
Returns:

The button component.

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

return (
    <Button onClick={ () => {} } size="size-height-xl" type="white">
        { 'Click me' }
    </Button>
);