Skip to content
Block Kit for React
Esc
↑↓navigate↵open⌘Jpreview
On this page

Checkboxes

A group of options where any number can be selected at once.

checkboxes renders a stack of checkbox options. Use it when someone can pick zero, one, or several options from a short list: an actions row or section accessory for a live toggle, or an input block to collect a value in a modal or Home tab.

Your AppAPP
onActionInteract with the preview.

Fields

PropType
typestring

Always `checkboxes`.

Typestring
optionsOption[]

The checkbox options, in order. Slack allows a maximum of 10.

TypeOption[]
initial_options?Option[]

A subset of `options` that starts checked. Each entry must match one of `options` by `value`.

TypeOption[]
action_id?string

Identifies this action in the interaction payload. Must be unique within the block. Maximum length is 255 characters.

Typestring
confirm?ConfirmationDialog

Shows a confirmation dialog before a check or uncheck is dispatched. See Confirmation dialogs.

TypeConfirmationDialog
focus_on_load?boolean

Focuses the first checkbox when the surface loads. Slack ignores this in messages and allows it on only one element per view.

Typeboolean
Defaultfalse

Each option is an Option object:

PropType
textPlainTextElement | MrkdwnElement

The option's label. Maximum length is 75 characters.

TypePlainTextElement | MrkdwnElement
value?string

Sent back in the interaction payload when this option is checked. Maximum length is 75 characters.

Typestring
description?PlainTextElement

A line of descriptive text shown below the label. Maximum length is 75 characters.

TypePlainTextElement

Examples

With initial options checked

The preview above starts with “Email me” already checked, using initial_options.

Without initial options

Your AppAPP
onActionInteract with the preview.

Every option starts unchecked, and onAction doesn’t fire until the first check.

With option descriptions

Your AppAPP
onActionInteract with the preview.

A description adds a second, muted line under the option’s label.

As a section accessory

Your AppAPP
Deployment options
Choose what runs after this merge.
onActionInteract with the preview.

As a section accessory, the group stacks below the section’s text instead of sitting beside it.

In an input block

Notification settings

Notify me about

With a confirmation dialog

Your AppAPP
onActionInteract with the preview.

The dialog only appears when checking an option on. Unchecking never asks for confirmation. See Confirmation dialogs.

Interactivity

Checking or unchecking an option (after any confirm dialog is accepted) calls onAction with the full, current set of checked options under selected_options, not just the one that changed:

{
  "type": "checkboxes",
  "action_id": "channels",
  "block_id": "notify",
  "action_ts": "1706000000.000100",
  "selected_options": [
    { "text": { "type": "plain_text", "text": "Email me" }, "value": "email" },
    { "text": { "type": "plain_text", "text": "Notify #general" }, "value": "general" }
  ]
}

Reading the value

Checkboxes write to state.values on mount (reporting initial_options, exactly like Slack does when the surface loads) and again on every change:

{
  "notify": {
    "channels": {
      "type": "checkboxes",
      "selected_options": [
        { "text": { "type": "plain_text", "text": "Email me" }, "value": "email" }
      ]
    }
  }
}

An unchecked group with no initial_options reports selected_options: [], not a missing key.

Was this page helpful?