Skip to main content

Radio button group element

Welcome to the new home of Slack developer docs!

We're still building and not all features are available quite yet. Enjoy this peek into the future!

Not ready for the future? Return to the past at api.slack.com.

Example:

An example of a radio button element

Fields

FieldTypeDescriptionRequired?
typeStringThe type of element. In this case type is always radio_buttons.Required
action_idStringAn identifier for the action triggered when the radio button group is changed. 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
optionsObject[]An array of option objects. A maximum of 10 options are allowed.Required
initial_optionObjectAn option object that exactly matches one of the options within options. This option will be selected when the radio button group initially loads.Optional
confirmObjectA confirm object that defines an optional confirmation dialog that appears after clicking one of the radio buttons in this element.Optional
focus_on_loadBooleanIndicates whether the element will be set to auto focus within the view object. Only one element can be set to true. Defaults to false.Optional

Example

A section block containing a set of radio buttons:

{
"type": "modal",
"title": {
"type": "plain_text",
"text": "My App",
"emoji": true
},
"submit": {
"type": "plain_text",
"text": "Submit",
"emoji": true
},
"close": {
"type": "plain_text",
"text": "Cancel",
"emoji": true
},
"blocks": [
{
"type": "section",
"text": {
"type": "plain_text",
"text": "Check out these rad radio buttons"
},
"accessory": {
"type": "radio_buttons",
"action_id": "this_is_an_action_id",
"initial_option": {
"value": "A1",
"text": {
"type": "plain_text",
"text": "Radio 1"
}
},
"options": [
{
"value": "A1",
"text": {
"type": "plain_text",
"text": "Radio 1"
}
},
{
"value": "A2",
"text": {
"type": "plain_text",
"text": "Radio 2"
},
"description": {
"type": "mrkdwn",
"text": "*Option two*"
},
}
]
}
}
]
}