Unify Applications
Logo
Button & Button Group

Button & Button Group

Logo

8 mins READ

The Button block renders a clickable button that runs actions when pressed. It has three behaviors — Default (runs your wired interactions), Submit, and Reset (which act on a Form block you select). Its label is bindable and translatable, with full appearance control: color, size, variant, start/end icons, and reactive Loading and Disabled conditions. Two add-ons extend it — a Tooltip on hover and Google reCAPTCHA verification.

buttons.png
buttons.png

Tip: When to use Button: Trigger any action on click — API call, modal, navigation, automation — with Behavior = Default. To submit or reset a form, set Behavior = Submit or Reset. For icon-only controls, use Icon Button. For related actions as one unit, use Button Group.

Properties

Content

Property

Type

Default

Description

contentMode (Type)

"text" | "custom"

text

Text shows a text label. Custom replaces the text label with a Body slot. Select the Body slot in the button's hierarchy to add icons, text or other blocks.

value

string

Button

The text shown on the button. Bindable, translatable, expression-friendly. Hidden when Type is Custom.

type

"default" | "submit" | "reset"

default

The button's behavior. Default runs your interactions; Submit and Reset act on a Form block.

formBlockId

block reference

—

Appears when type = submit or reset. (optional) The Form block this button submits or resets.

interactions

event → action list

—

Appears when type = default. (optional) Events and actions to run on click.

addOns.tooltip

string

—

Text shown in a tooltip when the user hovers the button.

addOns.reCaptcha.reCaptchaSiteKey

string

—

Site key from Google reCAPTCHA admin console. Gates the click behind a challenge.

addOns.reCaptcha.reCaptchaVersion

"reCaptchaV3" | "reCaptchaV2"

reCaptchaV3

V3 runs invisibly; V2 may show a challenge on failure.

Appearance

PropertyTypeDefaultDescription
colorbutton color tokenbrandThe button's color scheme.
sizebutton size tokenmdThe button's size.
variantbutton variant tokensolidThe button's fill style — solid, outline, or theme-defined styles.
startDecoratoricon name—Icon at the start (left) of the label. Bindable and conditional.
endDecoratoricon name—Icon at the end (right) of the label. Bindable and conditional.
loadingcondition—When true, shows a spinner and disables clicking.
disabledcondition—When true, the button is greyed out and not clickable.
stylesstyle setw-fitWidth, flex layout, margin, radius, visibility, rotation.

Events

EventTriggerAvailable when
On ClickUser clicks or taps the buttonAlways
On Mouse EnterPointer enters the buttonWeb / desktop only
On Long PressUser presses and holdsMobile / tablet only

Methods

MethodPayloadEffect
Set Disabled{ disabled: boolean }Enables or disables the button at runtime, overriding the Disabled condition.

Exposed State

State keyTypeDescription
{{ id.content.value }}stringThe button label after bindings resolve.
{{ id.content.type }}stringThe active behavior (default, submit, reset).
{{ id.appearance.* }}objectColor, size, variant, disabled, loading, and other appearance values.
{{ id.reCaptchaToken }}stringThe verification token — populated only after a successful reCAPTCHA challenge.

Behavior & Gotchas

Warning: reCAPTCHA, hover and the tooltip don't work in a mobile app. On native mobile, the button falls back to a plain click. On Mouse Enter, the Tooltip add-on and reCAPTCHA are web-only. On Long Press is the opposite: it fires only on mobile and tablet devices, and does nothing on desktop.

Warning: Set Disabled wins over your Disabled condition. Once Set Disabled runs, the button's disabled state is fixed to that boolean and ignores the Disabled condition until Set Disabled is called again.

Note: With reCAPTCHA on, the first click verifies — it does not run your action yet. The button shows a spinner, the challenge runs, and only after a token is returned does On Click fire. Later clicks fire immediately using the cached token.

Note: Submit and Reset do nothing until you pick a form. Without a form selected in "Form to submit / reset," clicking submits or resets nothing.

Note: A long press swallows the following click. On mobile, after a long press fires, the click that would follow is suppressed — you won't get both events from one gesture.

Button Group

The Button Group block renders a set of related buttons as one unit, in one of three types: Default (buttons side by side, each with its own click action), Dropdown (a single button that opens a menu of options), and Toggle (a segmented control where exactly one option stays selected). Buttons come from a Manual list or are Mapped from a data source.

Tip: When to use Button Group: Offer a small set of related actions together (approve / reject / escalate), collapse many actions behind one dropdown button, or build a view switcher toggle. For a single action, use the Button block.

Properties

Content

PropertyTypeDefaultDescription
mode"manual" | "mapped"manualManual builds buttons by hand; Mapped generates them from bound data.
type"default" | "dropdown" | "toggle"defaultSide-by-side, a dropdown menu, or a toggle (segmented) control.
textstringMenuDropdown only. (optional) The label on the dropdown trigger button.
options (Buttons)button list | data bindingThree sample buttonsManual: a list you add to; Mapped: a data source with Id and Label mappings.
initialSelectedItemIdstring—Toggle only. (optional) Which toggle option starts selected. Falls back to the first button.

Per-Button Settings (Manual mode)

Each button in the Manual list opens its own detail panel with: Label, Start/End Icons, Tooltip, Loading and Disabled conditions, On Click interactions, Visibility, and Permissions.

Appearance

PropertyTypeDefaultDescription
colorcolorbrandButton color for the whole group.
sizesizemdButton size for the whole group.
variantvariantsolidVisual style; Toggle type offers solid and outline only.
popup.stylesstyle setmax-h 400px, scrollDropdown only. (optional) Width/height/overflow of the dropdown menu.
stylesstyle setw-fitWidth/height, flex layout, visibility.

Events

EventTriggerAvailable when
On Click (per button)That button is clickedManual mode — on each button's detail panel
On Click (block)Any button in the group is clickedMapped mode — under Content → Interactions

Methods

MethodParamsEffectAvailable when
toggleButtonbuttonIdSelects the given toggle option programmaticallytype = toggle

Exposed State

State keyTypeDescription
{{ id.selectedOptionId }}stringId of the last-clicked button or current toggle selection.
{{ id.selectedOption.label }}stringLabel of the last-clicked button.
{{ id.context.item }}objectThe data item behind the clicked button (Mapped mode).

Behavior & Gotchas

Warning: A toggle group selects a button on page load — and fires its On Click. The auto-selection fires the On Click actions of the initially selected button on every page load. That is the first button, unless Initial Selected Item is set. Avoid placing load-sensitive logic (navigation, mutations) on that button.

Warning: The whole block disappears when no buttons survive. If every button is hidden by visibility or permissions, or a Mapped group's data is empty, the block renders nothing at all.

Note: Mapped buttons render only after you map the Id. Binding data alone is not enough — until the Id mapping is set, the block treats the list as empty. Map both Id and Label.

Note: The toggleButton method changes the selection silently. It updates the selection but doesn't run that button's On Click actions. After it runs, {{ id.selectedOption.label }} holds the button's id, not its label, until the user clicks a button. Read {{ id.selectedOptionId }} to get the selection.

Block

Relationship

Icon Button

An icon-only button. Use it when there's no text label.

Menu

Richer standalone menu when you need sections or nesting.

Link

Navigational text styled as an anchor rather than a button.

Floating Action Button

A persistent floating primary action, typically on mobile.

Swipeable Button

A slide-to-confirm control for deliberate or destructive actions.

FAQs

What is the difference between a Default and Submit button type?

A Default button fires its On Click event when pressed — it has no special relationship to a form. A Submit button, when paired with a Form block via the formBlockId property, triggers that form's validation before firing On Submit. If the form is invalid, the submit is blocked and validation errors are shown. Use Submit inside forms and Default for standalone actions like opening a modal or calling a data source.

Can I enable or disable a button from an automation?

Yes. The Button block exposes a Set Disabled method callable via the Control Block Method action. Pass true to disable it, false to re-enable. You can also drive disabled state reactively by binding the Disabled property to a condition on real block state, for example a check that a required value in {{ form1.data }} is empty.

How do I make a Button Group behave like a tab selector?

Set the Button Group Type to Toggle (Segmented) and Mode to Manual. Add the option items you want as tabs. {{ id.selectedOptionId }} holds the id of the selected toggle option, and you can use it to conditionally show sections or drive a Navigation Container.

When should I use a Dropdown button group instead of a plain Menu block?

Use a Dropdown button group when you want a primary action with secondary overflow actions, all grouped under one trigger button with a chevron. Use a Menu block when you need a standalone list of actions independent of any button — for example, a contextual right-click menu or an actions column in a table row.

What does the reCAPTCHA token state expose, and when does it update?

When the reCAPTCHA add-on is enabled, clicking the button triggers a reCAPTCHA challenge. On a successful challenge, {{ id.reCaptchaToken }} is set and On Click runs. The token stays in the block's state, so later clicks run On Click straight away without a new challenge. Send the token to your backend from the On Click actions and verify it server-side.