Skip to main content

Basic Example

Complete Example

Example Code

Properties

string
required
Identifies this as a button blockMust be button
string
required
The visible label text displayed on the button
string
required
A unique identifier for the button action. Included in the action payload when the button is clicked.
string
required
An optional value sent with the action payload when clicked. Useful for passing data to the action handler.
string
default:"default"
required
The visual style of the buttonAllowed values: primary, danger, default
string
required
A URL to open when the button is clicked. When set, the button acts as a link instead of triggering an action POST.
string
required
The endpoint URL to POST the action payload to when clicked. If not set, the parent actions block’s action_url is used.
object
required
An optional confirmation dialog shown before the action is executed.
boolean
default:"false"
required
When true, the button is rendered in a disabled state and cannot be clicked.

Action Payload

When a button is clicked, the following payload is POSTed to the action_url:

Server Response

The server can respond with one of these action types:

Usage Notes

  • Buttons are typically placed inside an Actions block
  • Buttons can also be placed inside Section and Column Layout blocks
  • When url is set, the button opens the URL instead of sending an action POST
  • The confirm dialog provides a safety net for destructive or irreversible actions