Layout

Image

::image places an image in a column, a card or a grid cell. For a full-height image, use the image-left, image-right or image layouts.

Live demo

Click the deck, then use ← → · 2 slides · 00:07Open fullscreen →

Syntax

MarkdownMarkdown
::image{src=./photo.svg alt="Purple gradient" fit=cover}
MarkdownMarkdown (image layout)
--- layout=image-right image=./photo.svg alt="Abstract purple illustration" # Full-height image
MDXMDX
<Image src="./photo.svg" alt="Purple gradient" fit="contain" caption="Lorem ipsum" />

Attributes and props

AttributeTypeDefaultDescription
srcstring—Image path or URL
altstring—Required for accessibility
fitcover | containcoverHow the image fills its box
captionReactNode (MDX)—Text shown under the image

Local images are copied into the build, or embedded in the single-file HTML export.

In other formats

FormatStatusNotes
deckAvailableRendered in slides, the presenter console and the HTML and PDF exports.
docsAvailableThrough <StoryEmbed slug="…" /> in any page of a site.
motionAvailableAnimated block in a film.
reportPlanned · P6Section of a paged report.
toonPlanned · P7Panel of a vertical strip.
bookPlanned · P8Block of a printable chapter.
Last modified on