Skip to main content

Button

A clickable button that triggers a function when pressed. Buttons are the primary way users interact with your widget, whether submitting forms, navigating between views, or performing actions.

Props

The onClickAction prop accepts an object with a functionName key that maps to one of your widget’s defined functions. You can also pass an additionalInputs object to send extra data along with the action.

Examples

Basic Action Button

A simple button that triggers a named function when clicked.

Form Submit Button

Use the submit prop to make the button submit its parent form. Pair this with a Card that has asForm set to true.
When submit is true, clicking the button collects all input values from the parent form and passes them to the function defined in the Card’s confirm action or the button’s own onClickAction.

Icon Button

Add icons before or after the label using iconStart and iconEnd. Use the uniform prop to create a square icon-only button.

Full-Width Button

Set block to true to make the button span the entire width of its container.

Button with Additional Inputs

Pass extra data alongside the action using additionalInputs. This is especially useful when rendering buttons in a loop, where each button needs to reference a specific item.
The additionalInputs object is merged with any form data when the action is triggered. Use it to attach contextual identifiers like IDs, indexes, or metadata to button clicks.