Frame
Styled <figure> wrapper for screenshots, diagrams, and embedded videos — with optional caption and muted hint. Keeps visual assets consistent across the site.
<Frame> wraps an image, diagram, or <video> in a semantic <figure> with a subtle border and optional captions. Use it for screenshots, UI references, architecture diagrams — anywhere you want a visual asset to feel “framed” rather than bleeding into prose.
Plain frame
import { Frame } from '@publier/shell/components';
<Frame> <img src="/logo.svg" alt="Publier logo" /></Frame>With caption
<Frame caption="Publier logo mark"> <img src="/logo.svg" alt="Publier logo" /></Frame>With caption + hint
The hint renders in a smaller muted style below the caption — good for “shown in light mode” or “taken at 1440px” notes:
<Frame caption="Publier logo mark" hint="Primary brand asset — matches the favicon."> <img src="/logo.svg" alt="Publier logo" /></Frame>Video
Pass video to apply video-specific aspect-ratio styling:
<Frame video caption="Publier scaffolder walkthrough"> <video src="/demo.mp4" controls autoplay muted loop /></Frame>A video can also come from props. With video and src set, Frame renders the <video> itself, always with the browser’s playback controls (so an autoplaying video can still be paused), and adds one <track> per entry of tracks for captions, subtitles, descriptions or chapters:
<Frame video src="/demo.mp4" caption="Publier scaffolder walkthrough" tracks={[{ src: "/demo.en.vtt", srclang: "en", label: "English", default: true }]}/>A decorative background loop that should have no controls can use a plain <video> element instead.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
caption | string | — | Visible caption below the frame. |
hint | string | — | Smaller muted line rendered after the caption. |
video | boolean | false | Applies a video-aspect-ratio modifier class. With src, renders the <video>. |
src | string | — | Video URL. Used when video is set. |
poster | string | — | Poster image for the video. |
autoPlay | boolean | false | Starts the video on load. Unless you set muted, an autoplaying video is muted, because browsers block unmuted autoplay. |
loop | boolean | false | Repeats the video. |
muted | boolean | — | Mutes the video. Defaults to true with autoPlay. |
tracks | { src, srclang, label, kind?, default? }[] | [] | Text tracks, rendered in the order given. kind is captions (default), subtitles, descriptions or chapters; default: true selects the track when the video loads. |
Otherwise children render inside the frame’s content slot — place the <img>, <video>, or embedded SVG there.
Behaviour
- Renders as
<figure>with the image/video as its child and an optional<figcaption>. - Zero JavaScript.
- Border and spacing pull from daisyUI’s
--color-base-300and adapt to every theme.