Image element
Displays an image as part of a larger block of content.
| Type | image |
| Available in | Messages, Modals, Home tab |
| Works in blocks | Section block, Context block, Card block |
Use the image element as a section block’s accessory, among a context block’s elements, or as a card block’s hero_image or icon. Use the image block if you want a block with only an image in it.
Fields
Section titled “Fields”| Field | Type | Description | Required? |
|---|---|---|---|
type |
String | The type of element. In this case type is always image. |
Required |
alt_text |
String | A plain-text summary of the image. This should not contain any markup. | Required |
image_url |
String | The URL for a publicly hosted image. Only http and https URLs are shown. Maximum length for this field is 3000 characters. |
Required |
Examples
Section titled “Examples”A section with an image
Section titled “A section with an image”
{ "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": "*Ergonomic Office Chair — Model E2*\nIn stock: 48 units · List price: *$329*\nBest seller this quarter in the Northwind account." }, "accessory": { "type": "image", "image_url": "https://picsum.photos/id/1062/300/300", "alt_text": "Office chair product photo" } } ]}Images in a context block
Section titled “Images in a context block”
{ "blocks": [ { "type": "context", "elements": [ { "type": "image", "image_url": "https://picsum.photos/id/1005/64/64", "alt_text": "Account owner avatar" }, { "type": "mrkdwn", "text": "Owned by the *Enterprise* team · Last activity 2 hours ago" } ] } ]}