Image
Displays an image with optional sizing, alt text, and a caption.
ctx.ui.display.image({ url, alt, size, caption });Config
url
stringThe URL of the image to display.
alt
stringAlternative text for the image, used for accessibility and in case the image fails to load.
size
"thumbnail" | "small" | "medium" | "large" | "full"Optional size preset to control the image’s display size. Defaults to natural size if not specified.
caption
stringOptional caption to display below the image.
key
stringIdentifies the element so a page's visibility rule can target it. Not shown in the UI. See Conditional visibility.
Usage
Use image elements to visually enhance pages with diagrams, photos, or illustrations.
ctx.ui.page({
title: "Image example",
content: [
ctx.ui.display.image({
url: "https://example.com/chart.png",
alt: "Chart showing sales trends",
size: "medium",
caption: "Sales trends over the past 6 months",
}),
],
});