Skip to main content

Icon button element

Fields

FieldTypeDescriptionRequired?
typeStringThe type of element. In this case type is always icon_button.Required
iconStringThe icon to show (e.g., "trash").Required
textObjectA text object that defines the button's text. Can only be of type: plain_text.Required
action_idStringAn 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_ids in the containing block. Maximum length is 255 characters.Optional
valueStringThe value to send along with the interaction payload. Maximum length is 2000 characters.Optional
confirmObjectA confirm object that defines an optional confirmation dialog after the button is clicked.Optional
accessibility_labelStringA 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_idsArrayAn 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"
}