Layout

Media

<Media> frames an image or a video with a shadow and an optional caption, and fades it in when the slide appears. It is available in .mdx stories.

Live demo

Click the deck, then use ← → · 1 slide · 00:00Open fullscreen →

Syntax

MDXMDX
import photo from "./photo.svg" --- layout=center <Media src={photo} alt="Purple gradient" caption="Lorem ipsum dolor sit amet" />
MDXMDX (video)
<Media type="video" src="/lorem.mp4" caption="Lorem ipsum" />

Attributes and props

PropTypeDefaultDescription
srcstring—Image or video URL
altstring"Illustration"Alternative text of the image
captionstring—Text shown under the media
typeimage | videoimageA video gets native controls
classNamestring—Extra CSS classes

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