Basic Example
Complete Example
Example Code
Properties
Identifies this as a button blockMust be
buttonThe visible label text displayed on the button
A unique identifier for the button action. Included in the action payload when the button is clicked.
An optional value sent with the action payload when clicked. Useful for passing data to the action handler.
The visual style of the buttonAllowed values:
primary, danger, defaultA URL to open when the button is clicked. When set, the button acts as a link instead of triggering an action POST.
The endpoint URL to POST the action payload to when clicked. If not set, the parent
actions block’s action_url is used.An optional confirmation dialog shown before the action is executed.
| Property | Type | Description |
|---|---|---|
title | string | Dialog title |
text | string | Confirmation message |
confirm_text | string | Text for the confirm button |
deny_text | string | Text for the cancel button |
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 theaction_url:
Server Response
The server can respond with one of these action types:| Response Type | Description |
|---|---|
replace | Replace the entire block with new BlockKit content |
update | Update specific properties of the block |
append | Append new blocks after the current block |
errors | Display validation errors |
Usage Notes
- Buttons are typically placed inside an Actions block
- Buttons can also be placed inside Section and Column Layout blocks
- When
urlis set, the button opens the URL instead of sending an action POST - The
confirmdialog provides a safety net for destructive or irreversible actions
