Button

The Button UI component is used to perform actions such as Add, Continue, Pay Now, or Save when clicked.

Preview

Button.jpg

Code example

render('Checkout::Dynamic::Render', () => {
return <Button onPress={() => console.log('onPress event')}>Pay now</Button>;
});

ButtonProps

tip

Optional properties are marked with a ?. Properties without a ? are required.

kind?

primary secondary Default: primary

The type of the button. Valid values are:

  • primary: Main button
  • secondary: Secondary button

size?

large small Default: large

The size of the button.


to?

string

The URL where the customer is redirected to after clicking the button. If you specify this property, the button will be rendered as a link.


loading?

boolean Default: false

Indicates whether to render the loading indicator. Valid values are:

  • true: Indicates rendering the loading indicator.
  • false: Indicates not rendering the loading indicator.

accessibilityLabel?

string

A label for this component. Configuring this feature directly sets the aria-label attribute, providing accessibility information for screen readers.


accessibilityRole?

button submit Default: button

Set the button role.


disabled?

boolean Default: false

Indicates whether the button is disabled for any interaction. Valid values are:

  • true: Indicates the button is disabled.
  • false: Indicates the button is interactive.

onPress?

() => void

The callback triggered when the button is pressed.


onMouseEnter?

() => void

The callback triggered when a mouse enters the button.


appearance?

critical

The appearance style of the button.


Was this article helpful to you?