A phone and a window, as one web component.
The frame draws the device – bezel, status bar, Dynamic Island, title bar – so a screenshot holds the page and nothing else, and one picture fits any frame.
The finish changes every phone on the page. Switch your device to dark mode to see the dark pictures and the status bar follow.
A screenshot
Put a picture inside. A <picture> with a dark source gives the visitor the shot that matches their theme.
<script type="module" src="https://cdn.jsdelivr.net/gh/tor2dbear/frames@v0.1.0/frames.js"></script>
<device-frame finish="natural">
<picture>
<source srcset="list-dark.png" media="(prefers-color-scheme: dark)">
<img src="list-light.png" width="786" height="1704" alt="…">
</picture>
</device-frame>



glare="off"Live
src instead of a picture: the page itself, laid out at the phone's size and scaled to the frame. Scroll it.
<device-frame src="/app/" title="The app, live" time="10:09"></device-frame>
A window
device="window", as wide as its container.

Attributes
device | phone (default) or window |
|---|---|
src | a page to show live, instead of the element's children |
viewport | the live page's size; a phone's is 393x764, a window's 1280x800 |
finish | black, natural, white, desert, purple, gold |
time | the status bar's clock, 9:41 by default |
ink | the status bar's colour: auto, black or white |
glare | off leaves the glass without its reflection |
title | the window's title, and a live page's accessible name |
--frame-width | the frame's width; everything scales with it |
The pictures
frames-capture takes them from the real page, in light and dark, with an iPhone's safe-area insets put into its CSS, so the content sits below the status bar. The status bar is left to the frame.
npm install --save-dev github:tor2dbear/frames playwright
npx frames-capture frames.config.mjs