Pro
Device frame
Show live UI inside a laptop or a phone. The lid opens and the whole device turns, but the screen is an ordinary subtree laid out at the device's true width (1280 or 390 pixels) inside a size container, so breakpoints and container queries behave exactly as in the product.
pnpm dlx shadcn@latest add @caliper/device-frameWhen to use
Use it for
- Docs and pages that preview a responsive screen.
- Comparing the same screen on a laptop and a phone.
Skip it when
- A hero image. Use real UI so the preview stays honest.
- Screens with state you cannot lose: changing device remounts the content.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- True width, then scaled
- The content is laid out at 1280 or 390 CSS pixels and scaled down to fit the model, so it breaks where the product breaks.
Usage
- The body is decoration
- The laptop and phone are hidden from assistive technology. The screen content stays in the reading and tab order.
Installation
pnpm dlx shadcn@latest add @caliper/device-frame
Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { DeviceFrame } from "@/components/ui/device-frame"
The worked example comes with Pro
The 110-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
DeviceFrame
component
Accessibility
It is built on native elements and keeps aria-hidden, aria-pressed, aria-label and aria-valuetext in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.