Skip to content
✨ Publier v1 is live — a polished docs platform built for the open web.
On this page

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

Publier logo
import { Frame } from '@publier/shell/components';
<Frame>
<img src="/logo.svg" alt="Publier logo" />
</Frame>

With caption

Publier logo
Publier logo mark
<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:

Publier logo
Publier logo markPrimary brand asset — matches the favicon.
<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

PropTypeDefaultDescription
captionstring—Visible caption below the frame.
hintstring—Smaller muted line rendered after the caption.
videobooleanfalseApplies a video-aspect-ratio modifier class. With src, renders the <video>.
srcstring—Video URL. Used when video is set.
posterstring—Poster image for the video.
autoPlaybooleanfalseStarts the video on load. Unless you set muted, an autoplaying video is muted, because browsers block unmuted autoplay.
loopbooleanfalseRepeats the video.
mutedboolean—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-300 and adapt to every theme.
  • Click-to-zoom image lightbox → ImageZoom.
  • Blur-up lazy image loading → BlurImage.
  • Inline icons (not full images) → Icons.