跳到主要内容
版本:v1.x.x

Button

Button widget can be used to take actions.

Properties

To add an event to a button, click on the widget handle to open the widget properties on the right sidebar. Go to the Events section and click on Add handler.

Events

ToolJet - Widget Reference - Button Events List

On click

On Click event is triggered when the button is clicked.

On hover

On hover event is triggered when the mouse cursor is moved over the button. Just like any other event on ToolJet, you can set multiple handlers for on click event.

信息

Check Action Reference docs to get the detailed information about all the Actions.

Properties

ToolJet - Widget Reference - Button Properties
PropertiesdescriptionExpected value
Button TextIt can be used to set the label of the button.Any String value: Send Message, Delete, or {{queries.xyz.data.action}}
Loading stateLoading state can be 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.Switch the toggle On or click on fx to programmatically set the value {{true}} or {{false}}

General

Tooltip

A Tooltip is often used to specify extra information about something when the user hovers the mouse pointer over the widget.

Under the General accordion, you can set the value in the string format. Now hovering over the widget will display the string as the tooltip.

ToolJet - Widget Reference - Tooltip

Layout

ToolJet - Widget Reference - Layout
LayoutdescriptionExpected value
Show on desktopToggle on or off to display desktop view.You can programmatically determine the value by clicking on Fx to set the value {{true}} or {{false}}
Show on mobileToggle on or off to display mobile view.You can programmatically determine the value by clicking on Fx to set the value {{true}} or {{false}}

Styles

ToolJet - Widget Reference - Button Styles
StyleDescription
Background colorYou can change the background color of the widget by entering the Hex color code or choosing a color of your choice from the color picker.
Text colorYou can change the color of the Text in button by entering the Hex color code or choosing a color of your choice from the color picker.
Loader colorYou can change the color of the loader in button by entering the Hex color code or choosing a color of your choice from the color picker. This will only be affective if the loading state property of the button is enabled.
VisibilityToggle on or off to control the visibility of the widget. You can programmatically change its value by clicking on the Fx button next to it. If {{false}} the widget will not visible after the app is deployed. By default, it's set to {{true}}.
DisableToggle on to lock the widget. You can programmatically change its value by clicking on the Fx button next to it, if set to {{true}}, the widget will be locked and becomes non-functional. By default, its value is set to {{false}}.
Border radiusUse this property to modify the border radius of the button.
Border colorAdd a color to the border of the button using this property.
信息

Any property having Fx button next to its field can be programmatically configured.