A phone, tablet or desktop browser drawn from tokens, with a screen that lays its content out at the device's real width and scales the frame to fit its container. Fill it with live components instead of screenshots; DeviceScreens swaps screens for feature tabs or scroll-synced chapters.
Installation
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { DeviceFrame, DeviceScreens } from "@vamos-ui/react";
<DeviceFrame device="phone" statusBar="09:41" label="Today screen: three tasks due">
<TodayScreen />
</DeviceFrame>
<DeviceFrame label={current.alt}>
<DeviceScreens active={tab} screens={features.map((f) => ({ id: f.id, content: f.screen }))} />
</DeviceFrame>
<DeviceFrame device="desktop" url="example.com/pricing" interactive label="Pricing page preview">
<PricingPage />
</DeviceFrame>The box reserves its aspect ratio in CSS, so the server render does not shift; the scale is applied once the width is measured.
A static frame is a picture: write label like an image alt (what the screen says), and keep the real information in the page text.
Scaling is a transform: text inside a strongly scaled frame gets small. Keep the important words outside the frame.
Examples
With feature tabs
Tabs drive one phone; every screen stays mounted and slides in. The frame's label follows the tab.
Scroll-synced
An IntersectionObserver picks the chapter crossing the middle; on a page use the viewport as root and a sticky frame.
See your day
Everything due today on one screen, done items crossed out.
Plan the week
Drag tasks between days and see how full each day is.
Share lists
Invite the people you live or travel with to a list.
Tablet and desktop
The same page at 820 and 1280 px; @container queries inside the screen switch the layout. interactive makes it a live, scrollable preview.
Simple plans
API
DeviceFrame
| Prop | Type | Default |
|---|---|---|
deviceFrame shape. Desktop is a browser window. | "phone" | "tablet" | "desktop" | "phone" |
viewportWidth / viewportHeightSimulated screen size in CSS px (defaults 390×844, 820×1180, 1280×800). | number | — |
maxScaleLargest scale; the frame never grows past it. | number | 1 |
statusBarTime at the start of a phone / tablet status bar. Omit to hide the bar. | ReactNode | — |
urlAddress in the desktop browser bar. | string | — |
interactiveLive content that scrolls inside. Otherwise the content is inert and hidden from assistive technology. | boolean | false |
labelWhat the screen shows (role="img" name, or the group's name when interactive). Without it a static frame is decorative. | string | — |
screenClassNameClasses for the screen element (laid out at the viewport size, an @container). | string | — |
DeviceScreens
| Prop | Type | Default |
|---|---|---|
screensAll screens; they stay mounted. | { id, content }[] | — |
activeId of the visible screen. | string | — |
transitionInstant under reduced motion. | "fade" | "slide" | "none" | "fade" |
Helpers
| Prop | Type | Default |
|---|---|---|
deviceViewportsDefault screen sizes. | Record<DeviceKind, { width, height }> | — |
deviceFrameSize(device, viewport?)Outer frame size at scale 1. | { width, height } | — |