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.
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
| Prop | Type | Description |
|---|---|---|
frame | "none" | "browser" | "desktop" | "mobile" | Frame style; defaults to none. |
title | ReactNode | Optional browser-bar label. |
caption | ReactNode | Optional semantic <figcaption>. |
children | ReactNode | Consumer-provided media content. |
className | string | Optional 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.
React Image Component
Display responsive React images with loading placeholders, error fallbacks, and aspect ratios. Learn native img props and framework image integration.
React Paper Surface Component
Add elevated surfaces to React layouts with Paper. Explore theme-based elevation, padding, and neutral containers without a card's content structure.