---
title: "Actions block"
summary: "Holds multiple interactive elements."
url: "https://docs.slack.dev/reference/block-kit/blocks/actions-block"
type: "reference"
subtype: "block-kit"
available_in_surfaces:
  - "Modals"
  - "Messages"
  - "Home tabs"
compatible_elements:
  - "Button"
  - "Checkboxes"
  - "Date picker"
  - "Datetime picker"
  - "Multi-select menu"
  - "Overflow menu"
  - "Radio button"
  - "Rich text input"
  - "Select menu"
  - "Time picker"
  - "Workflow buttons"
---

Source: https://docs.slack.dev/reference/block-kit/blocks/actions-block

# Actions block

## Fields {#fields}

Field

Type

Description

Required?

`type`

String

The type of block. For an actions block, `type` is always `actions`.

Required

`elements`

Object\[\]

An array of interactive [element objects](https://docs.slack.dev/reference/block-kit/block-elements.md) - [buttons](https://docs.slack.dev/reference/block-kit/block-elements/button-element.md), [select menus](https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element.md), [overflow menus](https://docs.slack.dev/reference/block-kit/block-elements/overflow-menu-element.md), or [date pickers](https://docs.slack.dev/reference/block-kit/block-elements/date-picker-element.md). There is a maximum of 25 elements in each action block.

Required

`block_id`

String

A unique identifier for a block. If not specified, a `block_id` will be generated. You can use this `block_id` when you receive an interaction payload to [identify the source of the action](https://docs.slack.dev/interactivity/handling-user-interaction.md#payloads). Maximum length for this field is 255 characters. `block_id` should be unique for each message and each iteration of a message. If a message is updated, use a new `block_id`.

Optional

## Examples {#examples}

**Example 1**: An actions block with a select menu and a button:

![An action block containing multiple interactive elements](https://docs.slack.dev/img/guides/block-kit/bk_actions_example.png)

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

```json
{
    "blocks": [
        {
            "type": "actions",
            "block_id": "actions1",
            "elements": [
                {
                    "type": "static_select",
                    "placeholder": {
                        "type": "plain_text",
                        "text": "Which witch is the witchiest witch?"
                    },
                    "action_id": "select_2",
                    "options": [
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Matilda"
                            },
                            "value": "matilda"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Glinda"
                            },
                            "value": "glinda"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Granny Weatherwax"
                            },
                            "value": "grannyWeatherwax"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Hermione"
                            },
                            "value": "hermione"
                        }
                    ]
                },
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "text": "Cancel"
                    },
                    "value": "cancel",
                    "action_id": "button_1"
                }
            ]
        }
    ]
}
```

[View in Block Kit Builder ](https://app.slack.com/block-kit-builder/#%7B%22blocks%22:%5B%7B%22type%22:%22actions%22,%22block_id%22:%22actions1%22,%22elements%22:%5B%7B%22type%22:%22static_select%22,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Which%20witch%20is%20the%20witchiest%20witch?%22%7D,%22action_id%22:%22select_2%22,%22options%22:%5B%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Matilda%22%7D,%22value%22:%22matilda%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Glinda%22%7D,%22value%22:%22glinda%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Granny%20Weatherwax%22%7D,%22value%22:%22grannyWeatherwax%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Hermione%22%7D,%22value%22:%22hermione%22%7D%5D%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Cancel%22%7D,%22value%22:%22cancel%22,%22action_id%22:%22button_1%22%7D%5D%7D%5D%7D)

```python
def example01() -> ActionsBlock:
    """
    Holds multiple interactive elements.
    https://docs.slack.dev/reference/block-kit/blocks/actions-block/

    An actions block with a select menu and a button.
    """
    block = ActionsBlock(
        block_id="actions1",
        elements=[
            StaticSelectElement(
                action_id="select_2",
                placeholder=PlainTextObject(text="Which witch is the witchiest witch?"),
                options=[
                    Option(text=PlainTextObject(text="Matilda"), value="matilda"),
                    Option(text=PlainTextObject(text="Glinda"), value="glinda"),
                    Option(
                        text=PlainTextObject(text="Granny Weatherwax"),
                        value="grannyWeatherwax",
                    ),
                    Option(text=PlainTextObject(text="Hermione"), value="hermione"),
                ],
            ),
            ButtonElement(
                text=PlainTextObject(text="Cancel"),
                value="cancel",
                action_id="button_1",
            ),
        ],
    )
    return block
```

```javascript
export function example01() {
  /**
   * @type {import('@slack/types').ActionsBlock}
   */
  const block = {
    type: "actions",
    block_id: "actions1",
    elements: [
      {
        type: "static_select",
        action_id: "select_2",
        placeholder: {
          type: "plain_text",
          text: "Which witch is the witchiest witch?",
        },
        options: [
          {
            text: {
              type: "plain_text",
              text: "Matilda",
            },
            value: "matilda",
          },
          {
            text: {
              type: "plain_text",
              text: "Glinda",
            },
            value: "glinda",
          },
          {
            text: {
              type: "plain_text",
              text: "Granny Weatherwax",
            },
            value: "grannyWeatherwax",
          },
          {
            text: {
              type: "plain_text",
              text: "Hermione",
            },
            value: "hermione",
          },
        ],
      },
      {
        type: "button",
        text: {
          type: "plain_text",
          text: "Cancel",
        },
        value: "cancel",
        action_id: "button_1",
      },
    ],
  };
  return block;
}
```

```java
public static ActionsBlock example01() {
    ActionsBlock block = Blocks.actions(a -> a.blockId("actions1")
            .elements(List.of(
                    BlockElements.staticSelect(s -> s.actionId("select_2")
                            .placeholder(BlockCompositions.plainText("Which witch is the witchiest witch?"))
                            .options(List.of(
                                    OptionObject.builder()
                                            .text(plainText("Matilda"))
                                            .value("matilda")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("Glinda"))
                                            .value("glinda")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("Granny Weatherwax"))
                                            .value("grannyWeatherwax")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("Hermione"))
                                            .value("hermione")
                                            .build()))),
                    BlockElements.button(b -> b.text(BlockCompositions.plainText("Cancel"))
                            .value("cancel")
                            .actionId("button_1")))));
    return block;
}
```

* * *

**Example 2**: An actions block with a datepicker, an overflow, and a button:

![An action block containing multiple interactive elements](https://docs.slack.dev/img/guides/block-kit/bk_actions_example_datepicker.png)

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

```json
{
    "blocks": [
        {
            "type": "actions",
            "block_id": "actionblock789",
            "elements": [
                {
                    "type": "datepicker",
                    "action_id": "datepicker123",
                    "initial_date": "1990-04-28",
                    "placeholder": {
                        "type": "plain_text",
                        "text": "Select a date"
                    }
                },
                {
                    "type": "overflow",
                    "options": [
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "*this is plain_text text*"
                            },
                            "value": "value-0"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "*this is plain_text text*"
                            },
                            "value": "value-1"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "*this is plain_text text*"
                            },
                            "value": "value-2"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "*this is plain_text text*"
                            },
                            "value": "value-3"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "*this is plain_text text*"
                            },
                            "value": "value-4"
                        }
                    ],
                    "action_id": "overflow"
                },
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "text": "Click Me"
                    },
                    "value": "click_me_123",
                    "action_id": "button"
                }
            ]
        }
    ]
}
```

[View in Block Kit Builder ](https://app.slack.com/block-kit-builder/#%7B%22blocks%22:%5B%7B%22type%22:%22actions%22,%22block_id%22:%22actionblock789%22,%22elements%22:%5B%7B%22type%22:%22datepicker%22,%22action_id%22:%22datepicker123%22,%22initial_date%22:%221990-04-28%22,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Select%20a%20date%22%7D%7D,%7B%22type%22:%22overflow%22,%22options%22:%5B%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22*this%20is%20plain_text%20text*%22%7D,%22value%22:%22value-0%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22*this%20is%20plain_text%20text*%22%7D,%22value%22:%22value-1%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22*this%20is%20plain_text%20text*%22%7D,%22value%22:%22value-2%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22*this%20is%20plain_text%20text*%22%7D,%22value%22:%22value-3%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22*this%20is%20plain_text%20text*%22%7D,%22value%22:%22value-4%22%7D%5D,%22action_id%22:%22overflow%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Click%20Me%22%7D,%22value%22:%22click_me_123%22,%22action_id%22:%22button%22%7D%5D%7D%5D%7D)

```python
def example02() -> ActionsBlock:
    """
    An actions block with a datepicker, an overflow, and a button.
    """
    block = ActionsBlock(
        block_id="actionblock789",
        elements=[
            DatePickerElement(
                action_id="datepicker123",
                initial_date="1990-04-28",
                placeholder=PlainTextObject(text="Select a date"),
            ),
            OverflowMenuElement(
                action_id="overflow",
                options=[
                    Option(
                        text=PlainTextObject(text="*this is plain_text text*"),
                        value="value-0",
                    ),
                    Option(
                        text=PlainTextObject(text="*this is plain_text text*"),
                        value="value-1",
                    ),
                    Option(
                        text=PlainTextObject(text="*this is plain_text text*"),
                        value="value-2",
                    ),
                    Option(
                        text=PlainTextObject(text="*this is plain_text text*"),
                        value="value-3",
                    ),
                    Option(
                        text=PlainTextObject(text="*this is plain_text text*"),
                        value="value-4",
                    ),
                ],
            ),
            ButtonElement(
                text=PlainTextObject(text="Click Me"),
                value="click_me_123",
                action_id="button",
            ),
        ],
    )
    return block
```

```javascript
export function example02() {
  /**
   * @type {import('@slack/types').ActionsBlock}
   */
  const block = {
    type: "actions",
    block_id: "actionblock789",
    elements: [
      {
        type: "datepicker",
        action_id: "datepicker123",
        initial_date: "1990-04-28",
        placeholder: {
          type: "plain_text",
          text: "Select a date",
        },
      },
      {
        type: "overflow",
        action_id: "overflow",
        options: [
          {
            text: {
              type: "plain_text",
              text: "*this is plain_text text*",
            },
            value: "value-0",
          },
          {
            text: {
              type: "plain_text",
              text: "*this is plain_text text*",
            },
            value: "value-1",
          },
          {
            text: {
              type: "plain_text",
              text: "*this is plain_text text*",
            },
            value: "value-2",
          },
          {
            text: {
              type: "plain_text",
              text: "*this is plain_text text*",
            },
            value: "value-3",
          },
          {
            text: {
              type: "plain_text",
              text: "*this is plain_text text*",
            },
            value: "value-4",
          },
        ],
      },
      {
        type: "button",
        text: {
          type: "plain_text",
          text: "Click Me",
        },
        value: "click_me_123",
        action_id: "button",
      },
    ],
  };
  return block;
}
```

```java
public static ActionsBlock example02() {
    ActionsBlock block = Blocks.actions(a -> a.blockId("actionblock789")
            .elements(List.of(
                    BlockElements.datePicker(d -> d.actionId("datepicker123")
                            .initialDate("1990-04-28")
                            .placeholder(BlockCompositions.plainText("Select a date"))),
                    BlockElements.overflowMenu(o -> o.actionId("overflow")
                            .options(List.of(
                                    OptionObject.builder()
                                            .text(plainText("*this is plain_text text*"))
                                            .value("value-0")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("*this is plain_text text*"))
                                            .value("value-1")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("*this is plain_text text*"))
                                            .value("value-2")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("*this is plain_text text*"))
                                            .value("value-3")
                                            .build(),
                                    OptionObject.builder()
                                            .text(plainText("*this is plain_text text*"))
                                            .value("value-4")
                                            .build()))),
                    BlockElements.button(b -> b.text(BlockCompositions.plainText("Click Me"))
                            .value("click_me_123")
                            .actionId("button")))));
    return block;
}
```
