Button
Type identifier:
buttonCategory: Experience Blocks
Description
Interactive block that renders Text and Image children and triggers configured actions.
Schema Summary
The Button block has the fields below, plus one action shape:
- modern
actionconfig, or - legacy Flow trigger config (compatibility)
Fields:
type: "button"variant?: "solid" | "ghost" | "soft"children: Array<text | image>loadingChildren?: Array<text | image>states?(array of state entries)
Action Configuration
Modern action (action):
kind: "flow"withflowId,triggerNodeId,inputMap, and optionalonSuccess(see Flow Actions), orkind: "preset"withpreset(authAction), orkind: "crud"withoperation, optionaltarget, and optionalonSuccess
Legacy compatibility shape:
flowId,triggerNodeId,inputMapat block root
Flow Actions
A Flow action runs the Flow's trigger with the inputs from Input Map. The button shows its loading content until the run ends.
On Success sets what happens after the run succeeds. Nothing happens if the run fails or is cancelled.
- None (default).
- Reset: discards the unsaved changes of the Reset Target entity context. A batch entity context resets every entity context inside it. Without a target, the nearest ancestor entity context is reset.
- Navigate: goes to a URL, an Experience, or an Auth Action.
For example, a sheet of draft cells can send its batch's changes to a Flow that saves them, then reset the batch so the cells are empty again; see Send Unsaved Changes to a Flow.
CRUD Actions
CRUD actions act on the targeted entity context, or on an editable row of a list, directly, without running a Flow. In the Studio editor, choose CRUD from the Action Type select to configure:
- Operation:
create,update,delete, orsave.saveupserts: it creates when the entity context isnewand updates whenloadedand dirty. - Target: an optional datum reference picker filtered to targets that can be saved: entity contexts over a Schema, batch entity contexts, and For Each items that are Records (see Editable Rows). A For Each item is not offered for
create, because a row is already a Record. When omitted, the action targets the nearest ancestor entity context in the rendered subtree; it never targets a row, so to save a row, target its For Each item explicitly. On Success: optional post-operation behaviour:
- Reset — discards unsaved edits and clears any CRUD error on the entity context.
- Refetch — reloads the target entity's data.
- Navigate — navigates to a configured Experience link (URL, Experience, or Auth Action).
When the target resolves to an entity context that is in batch mode (collecting descendant entity contexts), CRUD behaviour is:
saveiterates registered descendant entity contexts and saves each dirty entry. If no descendants are currently registered, this is a no-op success.create,update, anddeleteare rejected for batch mode targets.
Properties
Property | Type | Required | Notes |
|---|---|---|---|
|
| Yes | Shared block identifier. |
|
| Yes | Block discriminator. |
|
| No | Visual variant. |
|
| Yes | Primary child content. |
|
| No | Loading-state content; when omitted, |
| Object (see Action Configuration) | Yes* | Required in modern shape. |
|
| Yes* | Required in legacy shape. |
|
| Yes* | Required in legacy shape. |
|
| Yes* | Required in legacy shape. |
| Array of states | No | Optional state-specific overrides. |
The Button block also supports the shared style/layout/data props.
* One action shape is required: modern action or legacy flow fields.
States
State entries follow the shared state shape and support partial Button overrides.
Supported pseudo states:
hoverfocusactivedisabled
The disabled state can also be driven by data: with it selected, + Add condition sets an activation condition. While the condition holds, the button is disabled (it can't be clicked) and shows the state's overrides. For example, a Save button can stay disabled until there are unsaved changes; see Show Unsaved Changes and Enable Save.
Minimal Valid Example
{
"id": "btn-1",
"type": "button",
"children": [
{
"id": "txt-1",
"type": "text",
"text": "Submit"
}
],
"action": {
"kind": "preset",
"preset": "logout"
}
}Maximal Example
This example shows the Button-specific fields together with representative shared style, layout, responsive, and state properties. loadingChildren is optional; when it is omitted, the regular children render while the action is running.
{
"id": "btn-submit-1",
"type": "button",
"name": "submit-button",
"variant": "solid",
"children": [
{
"id": "btn-submit-label",
"type": "text",
"name": "submit-label",
"text": "Submit application",
"htmlElement": "p",
"color": "#ffffff",
"fontSize": "14px",
"fontWeight": "600",
"textAlign": "center",
"padding": "0 4px"
},
{
"id": "btn-submit-icon",
"type": "image",
"name": "submit-icon",
"src": "https://example.com/icons/arrow-right.png",
"alt": "",
"width": 16,
"height": 16,
"objectFit": "contain",
"margin": "0 0 0 8px"
}
],
"loadingChildren": [
{
"id": "btn-submit-loading-label",
"type": "text",
"name": "submit-loading-label",
"text": "Submitting...",
"htmlElement": "p",
"color": "#ffffff",
"fontSize": "14px",
"fontWeight": "600",
"textAlign": "center"
}
],
"width": "200px",
"height": "40px",
"padding": "0 16px",
"margin": "8px 0",
"backgroundColor": "#2563eb",
"borderWidth": "1px",
"borderColor": "#1d4ed8",
"borderRadius": "6px",
"boxShadow": [
{
"color": "rgba(0, 0, 0, 0.12)",
"offsetX": "0px",
"offsetY": "1px",
"blurRadius": "2px"
}
],
"display": "inline-flex",
"direction": "row",
"align": "center",
"justify": "center",
"gap": "8px",
"transition": [
{
"property": "background-color",
"duration": {
"value": 150,
"unit": "ms"
},
"timingFunction": "ease-out"
}
],
"breakBefore": "auto",
"breakAfter": "avoid",
"states": [
{
"id": "hover",
"name": "Hover",
"overrides": {
"backgroundColor": "#1d4ed8",
"borderColor": "#1e40af"
}
},
{
"id": "disabled",
"name": "Disabled",
"overrides": {
"backgroundColor": "#93c5fd",
"borderColor": "#93c5fd",
"children": [
{
"id": "btn-submit-disabled-label",
"type": "text",
"text": "Submit application",
"color": "#eff6ff"
}
]
}
}
],
"action": {
"kind": "preset",
"preset": "logout"
}
}