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

Carousel

A horizontally scrollable row of cards.

carousel lays out a row of cards with arrow buttons to scroll between them. It’s a library-invented block, not part of the public @slack/types package.

Your AppAPP
onActionInteract with the preview.

Fields

PropType
typestring

Always `carousel`.

Typestring
elements?Card[]

The cards, in scroll order. Each has the same fields as a standalone card block.

TypeCard[]

A card inside elements can set its own block_id; when it doesn’t, this library generates carousel-card-{i} so its actions still have a stable id to key off in onAction.

Examples

Several cards

The preview above scrolls through three cards. Use the arrow buttons, or drag, to move between them.

Your AppAPP

An empty elements array still renders both scroll arrows, disabled since there’s nothing to scroll to.

Interactivity

Each card’s own actions dispatch the standard block_actions payload described in Card → Interactivity. The scroll arrows are a client-side affordance only. They don’t emit an action or appear in onAction.

Was this page helpful?