Skip to content
caliper ui pro docs

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.

Pro
9:41

Halden · Oct 2026

Overview

MRR$48.2k+8.4%
Trials312+21

Revenue, 8 weeks

  • Acme CoTeam$199
  • NorthwindPro$99
  • InitechPro$99

When to use

  • Docs and pages that preview a responsive screen.
  • Comparing the same screen on a laptop and a phone.

When not to use

  • A hero image. Use real UI so the preview stays honest.
  • Screens with state you cannot lose: changing device remounts the content.

Installation

terminal
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.

API reference

DeviceFrame

14 props
PropTypeDefaultDescription
children *ReactNode—The screen. It is laid out at 1280px (laptop) or 390px (phone) wide.
deviceDeviceKind—
defaultDeviceDeviceKind"laptop"
onDeviceChange((device: DeviceKind) => void)—
openboolean—Whether the laptop lid is open.
defaultOpenbooleantrue
onOpenChange((open: boolean) => void)—
defaultTurnnumber0Starting turn in degrees, -40 to 40.
controlsbooleantrueShow the device, lid and turn controls.
statusDepthStatus"ready"
messagesDepthMessages—
onRetry(() => void)—
disabledboolean—
classNamestring—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It is built on native elements and keeps aria-hidden, aria-pressed, aria-label and aria-valuetext in step with state.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/device-frame.md

The index of every part is at /llms.txt.

More in Surfaces