Learn about the LoadingButton component for use in UI extensions.
LoadingButton
component renders a button with loading state options. It includes the same props as the Button component with a few additional props for managing loading state.
Prop | Type | Description |
---|---|---|
href | String | Include this prop to open a URL on click. Contains the following fields:
href and an onClick action, both will be executed on button click. |
onClick | () => void | A function that will be invoked when the button is clicked. It receives no arguments and its return value is ignored. |
disabled | Boolean | When set to true , the button will render in a greyed-out state and cannot be clicked. |
variant | 'primary' | 'secondary' (default) | 'destructive' | Sets the color of the button. See variants section for more information. |
type | 'button' (default) | 'reset' | 'submit' | Sets the role HTML attribute of the button. |
size | 'xs' , 'extra-small' | 'sm' , 'small' | 'med' , 'medium' (default) | The size of the button. |
loading | Boolean | Set to true to display the loading indicator and disable the button. Default is false . |
resultIconName | String | Set to an icon name to display an icon after loading. By default, will display a check mark. |
overlay | Object | Include a Modal or Panel component in this object to open it as an overlay on click. Learn more about using overlays. |
LoadingButton
component can open an overlay. In addition, you can use the overlayOptions
prop to trigger the overlay either on click or when the loading has finished.
variant
prop, you can set the color of the button.
'primary'
button at the end of a form to submit data to another system.'secondary'
button next to a primary form submit button to reset form fields.'destructive'
button to enable users to delete a contact’s data from an external system.disabled={true}
when a contact doesn’t qualify for a form submission due to missing criteria or other ineligibility.external: true
).