---
title: "Radio button group element"
summary: "Allows users to choose one item from a list of possible options."
url: "https://docs.slack.dev/reference/block-kit/block-elements/radio-button-group-element"
type: "reference"
subtype: "block-kit"
available_in_surfaces:
  - "Modals"
  - "Messages"
  - "Home tabs"
works_with_blocks:
  - "Section"
  - "Actions"
  - "Input"
---

Source: https://docs.slack.dev/reference/block-kit/block-elements/radio-button-group-element

# Radio button group element

Example:

![An example of a radio button element](https://docs.slack.dev/img/guides/block-kit/bk_radio_example.png)

## Fields {#fields}

Field

Type

Description

Required?

`type`

String

The type of element. In this case `type` is always `radio_buttons`.

Required

`action_id`

String

An 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](https://docs.slack.dev/interactivity/handling-user-interaction.md#payloads). Should be unique among all other `action_id`s in the containing block. Maximum length is 255 characters.

Optional

`options`

Object\[\]

An array of [option objects](https://docs.slack.dev/reference/block-kit/composition-objects/option-object.md). A maximum of 10 options are allowed.

Required

`initial_option`

Object

An [option object](https://docs.slack.dev/reference/block-kit/composition-objects/option-object.md) that exactly matches one of the options within `options`. This option will be selected when the radio button group initially loads.

Optional

`confirm`

Object

A [confirm object](https://docs.slack.dev/reference/block-kit/composition-objects/confirmation-dialog-object.md) that defines an optional confirmation dialog that appears after clicking one of the radio buttons in this element.

Optional

`focus_on_load`

Boolean

Indicates whether the element will be set to auto focus within the [`view object`](https://docs.slack.dev/reference/views.md). Only one element can be set to `true`. Defaults to `false`.

Optional

## Example {#example}

The radio button group element must be used inside of the [section](https://docs.slack.dev/reference/block-kit/blocks/section-block.md) block, [actions](https://docs.slack.dev/reference/block-kit/blocks/actions-block.md) block, or [input](https://docs.slack.dev/reference/block-kit/blocks/input-block.md) block. This example shows a section block containing a set of radio buttons:

*   JSON
*   Python Slack SDK
*   Node Slack SDK
*   Java Slack SDK

```json
{
    "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"
                        }
                    }
                ]
            }
        }
    ]
}
```

[View in Block Kit Builder ](https://app.slack.com/block-kit-builder/T024BE7LD#%7B%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Check%20out%20these%20rad%20radio%20buttons%22%7D,%22accessory%22:%7B%22type%22:%22radio_buttons%22,%22action_id%22:%22this_is_an_action_id%22,%22initial_option%22:%7B%22value%22:%22A1%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Radio%201%22%7D%7D,%22options%22:%5B%7B%22value%22:%22A1%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Radio%201%22%7D%7D,%7B%22value%22:%22A2%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Radio%202%22%7D%7D%5D%7D%7D%5D%7D)

```python
def example01() -> SectionBlock:
    """
    Allows users to choose one item from a list of possible options.
    https://docs.slack.dev/reference/block-kit/block-elements/radio-button-group-element/

    A section block with a radio buttons accessory.
    """
    block = SectionBlock(
        text=PlainTextObject(text="Check out these rad radio buttons"),
        accessory=RadioButtonsElement(
            action_id="this_is_an_action_id",
            initial_option=Option(value="A1", text=PlainTextObject(text="Radio 1")),
            options=[
                Option(value="A1", text=PlainTextObject(text="Radio 1")),
                Option(value="A2", text=PlainTextObject(text="Radio 2")),
            ],
        ),
    )
    return block
```

```javascript
export function example01() {
  /**
   * @type {import('@slack/types').SectionBlock}
   */
  const block = {
    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",
          },
        },
      ],
    },
  };
  return block;
}
```

```java
public static SectionBlock example01() {
    SectionBlock block =
            Blocks.section(s -> s.text(BlockCompositions.plainText("Check out these rad radio buttons"))
                    .accessory(BlockElements.radioButtons(r -> r.actionId("this_is_an_action_id")
                            .initialOption(OptionObject.builder()
                                    .value("A1")
                                    .text(BlockCompositions.plainText("Radio 1"))
                                    .build())
                            .options(List.of(
                                    OptionObject.builder()
                                            .value("A1")
                                            .text(BlockCompositions.plainText("Radio 1"))
                                            .build(),
                                    OptionObject.builder()
                                            .value("A2")
                                            .text(BlockCompositions.plainText("Radio 2"))
                                            .build())))));
    return block;
}
```

* * *
