Where it sits
| Body | In the body | Inside its texts |
|---|---|---|
| The store’s home | Yes | Yes |
| A custom page | Yes | Yes |
| A product’s page | Yes | Yes |
| An event’s page | Yes | Yes |
| A portfolio’s page | Yes | Yes |
| A lesson | Yes | Yes |
| An article | Yes | Yes |
A text holds it as a <block type="image" props="…"></block> element: its props are those below but type, which the element’s own type names.
See Bodies for how a body holds its blocks.
Props
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | The block’s id, unique within its body. |
type |
"image" |
Yes | The block’s type. |
src |
string |
No | An external URL, when no fileId names a store file. Defaults to "". |
alt |
string |
No | The image described, for those who can’t see it. Defaults to "". |
width |
number |
No | Its width in pixels. |
height |
number |
No | Its height in pixels. |
fileId |
string |
No | A store file’s id, listed in the read’s files. |
caption |
string |
No | A caption under it. |
borderless |
boolean |
No | Whether it shows without its frame. |
size |
"small" or "medium" or "full" |
No | How wide it shows: small, medium or full. |
fit |
"contain" or "cover" |
No | Whether the media is cropped to its frame (cover) or fits inside it (contain). |
align |
"start" or "center" or "end" |
No | How its content aligns: start, center or end. |
hidden |
boolean |
No | Whether the block is hidden: it, and every block it holds, doesn’t show. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The block's id, unique within its body."
},
"type": {
"type": "string",
"const": "image",
"description": "The block's type."
},
"src": {
"default": "",
"type": "string",
"description": "An external URL, when no `fileId` names a store file."
},
"alt": {
"default": "",
"type": "string",
"description": "The image described, for those who can't see it."
},
"width": {
"type": "number",
"description": "Its width in pixels."
},
"height": {
"type": "number",
"description": "Its height in pixels."
},
"fileId": {
"type": "string",
"description": "A store file's id, listed in the read's `files`."
},
"caption": {
"type": "string",
"description": "A caption under it."
},
"borderless": {
"type": "boolean",
"description": "Whether it shows without its frame."
},
"size": {
"type": "string",
"enum": [
"small",
"medium",
"full"
],
"description": "How wide it shows: `small`, `medium` or `full`."
},
"fit": {
"type": "string",
"enum": [
"contain",
"cover"
],
"description": "Whether the media is cropped to its frame (`cover`) or fits inside it (`contain`)."
},
"align": {
"type": "string",
"enum": [
"start",
"center",
"end"
],
"description": "How its content aligns: `start`, `center` or `end`."
},
"hidden": {
"type": "boolean",
"description": "Whether the block is hidden: it, and every block it holds, doesn't show."
}
},
"required": [
"id",
"type"
],
"description": "An image: a store file, or an external URL.",
"additionalProperties": false
}