Container
Groups blocks together with a shared border, an optional header, and a width limit.
container wraps a list of child blocks with a border and background, an optional header with an
icon, title, and subtitle, and a width variant. It can also be made collapsible. It’s a library-invented
block, not part of the public @slack/types package.
Fields
typestring
Always `container`.
stringtitle?PlainTextElement | MrkdwnElement
Bold text in the header.
PlainTextElement | MrkdwnElementsubtitle?PlainTextElement | MrkdwnElement
Muted text under the title.
PlainTextElement | MrkdwnElementicon?{ type: "image"; image_url: string; alt_text?: string }
A 36×36 rounded icon, left of the title and subtitle.
{ type: "image"; image_url: string; alt_text?: string }width?"narrow" | "standard" | "wide" | "full"
The container's max width. An unrecognized or omitted value falls back to `standard`.
"narrow" | "standard" | "wide" | "full""standard"is_collapsible?boolean
Makes the header a toggle button with a chevron. When true, the header always renders even with no title, subtitle, or icon.
booleanfalsedefault_collapsed?boolean
Starts the container collapsed. Only takes effect when `is_collapsible` is `true`.
booleanfalsehas_header_divider?boolean
Adds a border between the header and the body.
booleanfalsechild_blocks?Block[]
Blocks rendered inside the container.
Block[]Examples
Widths
Collapsible
Set default_collapsed: true to start it collapsed instead.
Header divider
Icon and subtitle
The preview at the top of this page shows a container with an icon, title, and subtitle together.
Interactive children
A container doesn’t intercept its children’s interactions. An input or actions block inside it
dispatches the same block_actions payload it would at the top level.
Interactivity
Interactive child_blocks (buttons, selects, inputs) dispatch Slack’s standard block_actions
payload, keyed by whatever block_id and action_id that child block declares. See
Interactivity for the full payload shape.