# Carousel block

> Displays related [card blocks](/docs/developers/block-kit/blocks/card-block) side by side in a horizontally scrolling row.

Displays related [card blocks](https://workstation.repzo.com/docs/developers/block-kit/blocks/card-block) side by side in a horizontally scrolling row.

| | |
|---|---|
| **Type** | `carousel` |
| **Available in** | Messages, Modals, Home tab |

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `type` | String | The type of block. For a carousel block, `type` is always `carousel`. | Required |
| `elements` | Array of [Card block](https://workstation.repzo.com/docs/developers/block-kit/blocks/card-block) | The cards to show. Minimum 1, maximum 10. | Required |
| `block_id` | String | A unique identifier for the block. Maximum length is 255 characters. It must be unique within the message or view — a duplicate is replaced and reported as a warning. | Optional |

> **How Repzo Chat differs from Slack**
>
> - Slack shows carousels in messages and the Home tab. Repzo shows them in modals too.
> - Anything in `elements` that isn't a card is skipped and the API returns a warning.

## Examples

### Recommended products

```json
{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Customers who bought *POS Terminal X2* also ordered:"
      }
    },
    {
      "type": "carousel",
      "elements": [
        {
          "type": "card",
          "hero_image": {
            "type": "image",
            "image_url": "https://picsum.photos/id/0/600/400",
            "alt_text": "Receipt printer"
          },
          "title": {
            "type": "plain_text",
            "text": "Thermal receipt printer"
          },
          "body": {
            "type": "mrkdwn",
            "text": "80 mm, USB and Ethernet. *SAR 650*"
          },
          "actions": [
            {
              "type": "button",
              "action_id": "add_printer",
              "text": {
                "type": "plain_text",
                "text": "Add to order"
              },
              "value": "PRN-80"
            }
          ]
        },
        {
          "type": "card",
          "hero_image": {
            "type": "image",
            "image_url": "https://picsum.photos/id/3/600/400",
            "alt_text": "Barcode scanner"
          },
          "title": {
            "type": "plain_text",
            "text": "Wireless barcode scanner"
          },
          "body": {
            "type": "mrkdwn",
            "text": "1D/2D, 30 m range. *SAR 420*"
          },
          "actions": [
            {
              "type": "button",
              "action_id": "add_scanner",
              "text": {
                "type": "plain_text",
                "text": "Add to order"
              },
              "value": "SCN-2D"
            }
          ]
        },
        {
          "type": "card",
          "hero_image": {
            "type": "image",
            "image_url": "https://picsum.photos/id/6/600/400",
            "alt_text": "Cash drawer"
          },
          "title": {
            "type": "plain_text",
            "text": "Cash drawer"
          },
          "body": {
            "type": "mrkdwn",
            "text": "5 notes, 8 coins, steel. *SAR 380*"
          },
          "actions": [
            {
              "type": "button",
              "action_id": "add_drawer",
              "text": {
                "type": "plain_text",
                "text": "Add to order"
              },
              "value": "CD-58"
            }
          ]
        }
      ]
    }
  ]
}
```

## Related

- [Blocks](https://workstation.repzo.com/docs/developers/block-kit/blocks)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
