Icon button element
Fields
Field | Type | Description | Required? |
---|---|---|---|
type | String | The type of element. In this case type is always icon_button . | Required |
icon | String | The icon to show (e.g., "trash"). | Required |
text | Object | A text object that defines the button's text. Can only be of type: plain_text . | Required |
action_id | String | An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other action_id s in the containing block. Maximum length is 255 characters. | Optional |
value | String | The value to send along with the interaction payload. Maximum length is 2000 characters. | Optional |
confirm | Object | A confirm object that defines an optional confirmation dialog after the button is clicked. | Optional |
accessibility_label | String | A label for longer descriptive text about a button element. This label will be read out by screen readers instead of the button text object. Maximum length is 75 characters. | Optional |
visible_to_user_ids | Array | An array of user IDs for which the icon button appears. If not provided, the button is visible to all users. | Optional |
Examples
A basic icon button:
{
"type": "icon_button",
"icon": "trash",
"text": {
"type": "plain_text",
"text": "Delete"
},
"action_id": "delete_button",
"value": "delete_item"
}