Skip to Content

MediaFrame

Wrap consumer-provided product media in responsive browser, desktop, or mobile device frames.

MediaFrame adds optional browser, desktop, or mobile device chrome around consumer-provided media. It can also render the media without a frame.

Import

import { MediaFrame, type MediaFrameProps } from "@puzzle-ui/ui";

Browser frame

Decorative browser controls are hidden from assistive technology. The title labels the visual browser bar, while caption renders as a semantic figure caption.

390 × 844

Device frames

Use frame="desktop" for a wide screen composition and frame="mobile" for a narrow portrait composition. The mobile frame is capped in width and shrinks to fit its container. The component does not crop, load, or generate media for you.

<MediaFrame frame="mobile" caption="Mobile app">
  <img src="/mobile.png" alt="Mobile view of the project workspace" />
</MediaFrame>

API

PropTypeDescription
frame"none" | "browser" | "desktop" | "mobile"Frame style; defaults to none.
titleReactNodeOptional browser-bar label.
captionReactNodeOptional semantic <figcaption>.
childrenReactNodeConsumer-provided media content.
classNamestringOptional class name for the figure root.

Accessibility

Use informative alternative text for images and captions when useful. Browser chrome and device stands are decorative. The component is presentational and server-renderable.