# Blocks

> The closed catalog of layout blocks a bot message, a modal or a Home tab is made of.

Source: https://slaiky.xyz/docs/reference/blocks

A message can carry up to 50 blocks next to its `text`. People who can’t see blocks (notifications, search, previews) read the `text`, so always send one. Blocks come from this catalog only; anything else is refused with the field that is wrong.

## Message blocks

### `header`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `text` | string | yes | 1–150 characters. |

### `section`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `text` | string | no | Up to 3,000 characters. |
| `fields` | array of string | no | Up to 10 items. |
| `accessory` | value | no |  |

### `actions`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `elements` | array of value | yes | Up to 5 items. |

### `context`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `elements` | array of string | yes | Up to 10 items. |

### `divider`

No arguments.

### `image`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `url` | URL | yes | Up to 3,000 characters. |
| `alt` | string | no | Up to 2,000 characters. |

## Elements

Buttons and menus go in an `actions` block or as a section’s `accessory`; input elements go in an `input` block (modals and Home only).

### `button`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `text` | string | yes | 1–75 characters. |
| `actionId` | string | yes | 1–255 characters. |
| `value` | string | no | Up to 2,000 characters. |
| `style` | `"primary"` / `"danger"` | no |  |
| `url` | URL | no | Up to 3,000 characters. |

### `static_select`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `actionId` | string | yes | 1–255 characters. |
| `options` | array of object | yes | Up to 100 items. |
| `placeholder` | string | no | Up to 150 characters. |
| `initialValue` | string | no | Up to 2,000 characters. |

### `plain_text_input`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `actionId` | string | yes | 1–255 characters. |
| `placeholder` | string | no | Up to 150 characters. |
| `initialValue` | string | no | Up to 3,000 characters. |
| `multiline` | boolean | no |  |
| `minLength` | integer | no | 0–3,000. |
| `maxLength` | integer | no | 1–3,000. |

### `checkboxes`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `actionId` | string | yes | 1–255 characters. |
| `options` | array of object | yes | Up to 10 items. |
| `initialValues` | array of string | no | Up to 10 items. |

### `datepicker`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `actionId` | string | yes | 1–255 characters. |
| `placeholder` | string | no | Up to 150 characters. |
| `initialDate` | string | no |  |

## Views

A modal or a Home tab: `views.open`, `views.push`, `views.update`, `views.publish`. Its blocks are the message blocks plus `input`.

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `blocks` | [blocks](/docs/reference/blocks) | yes | Up to 50 items. |
| `title` | string | no | 1–24 characters. |
| `submit` | string | no | 1–24 characters. |
| `close` | string | no | 1–24 characters. |
| `callbackId` | string | no | Up to 255 characters. |
| `privateMetadata` | string | no | Up to 3,000 characters. |
| `notifyOnClose` | boolean | no |  |

### `input`

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `blockId` | string | yes | 1–255 characters. |
| `label` | string | yes | 1–150 characters. |
| `element` | value | yes |  |
| `hint` | string | no | Up to 300 characters. |
| `optional` | boolean | no |  |
