Button
Button component can be used to trigger an action. It can be used to submit a form, navigate to another page, or trigger a query.
Properties​
Property | Description | Expected Value |
---|---|---|
Label | Text to display on the button. | String (e.g., Submit ). |
Events​
Event | Description |
---|---|
On click | Triggers whenever the user clicks the button. |
On hover | Triggers whenever the user moves the mouse cursor over the button. |
info
Check Action Reference docs to get detailed information about all the Actions.
Property | Description | Expected Value |
---|---|---|
Button text | Used to set the label of the button. | Any String value: Send Message , Delete , or {{queries.xyz.data.action}} . |
Loading state | The loading state is used to show a spinner as the button content. Loading state is commonly used with isLoading property of the queries to show a loading status while a query is being run. | Toggle the switch On or click on fx to programmatically set the value to {{true}} or {{false}} . |
Component Specific Actions (CSA)​
Following actions of Button component can be controlled using the component specific actions(CSA):
Actions | Description | How To Access |
---|---|---|
click() | Regulate the click of the button. | Employ a RunJS query to execute component-specific actions such as await components.button1.click() or trigger it using an event. |
setText() | Sets the label of the component. | Employ a RunJS query (for e.g., await components.button1.setText('Update') ) or trigger it using an event. |
setVisibility() | Sets the visibility of the component. | Employ a RunJS query (for e.g., await components.textinput1.setVisibility(false) ) or trigger it using an event. |
setLoading() | Sets the loading state of the component. | Employ a RunJS query (for e.g., await components.button1.setLoading(true) ) or trigger it using an event. |
setDisable() | Disables the component. | Employ a RunJS query (for e.g., await components.button1.setDisable(true) ) or trigger it using an event. |
Exposed Variables​
Variable | Description | How To Access |
---|---|---|
buttonText | This variable stores the text displayed on the button. | Access the value dynamically through JavaScript using the following syntax: {{components.button1.buttonText}} . |
isValid | Indicates if the input meets validation criteria. | Accessible dynamically with JS (for e.g., {{components.button1.isValid}} ). |
isLoading | Indicates if the component is loading. | Accessible dynamically with JS (for e.g., {{components.button1.isLoading}} ). |
isVisible | Indicates if the component is visible. | Accessible dynamically with JS (for e.g., {{components.button1.isVisible}} ). |