Device Mockups
An iPhone, Android phone, tablet or browser window around a screenshot, live React or a full app screen.
- Category
- Marketing
- Access
- Free with an account
- Source
- 180 lines · one file
- States
- 5 drawn
- Added
- 3 Nov 2026
The decision inside it
The screen is laid out at the device's real width
The content renders at 390 px for the iPhone or 1280 for the browser and is then scaled to fit, so a responsive screen shows its phone layout inside the phone and its sidebar layout in the browser. The safe area sits outside the screen's scrolling.
When to use it
Use Device Mockups on landing and docs pages to show a screen in a phone, tablet or browser frame, as a screenshot or live React.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Device Mockups for this.
Install it: npx shadcn@latest add @liro/device-mockup
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/device-mockup.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { DeviceMockup } from "@/components/ui/device-mockup";
export function AppPreview() {
return (
<div className="flex items-end gap-8">
<DeviceMockup device="browser" url="app.madgixs.com" src="/shots/dashboard.png" alt="Madgixs dashboard" className="w-[640px]" />
<DeviceMockup device="iphone" src="/shots/mobile.png" alt="Madgixs on iPhone" className="w-[220px]" />
</div>
);
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
device | DeviceKind | No | – |
src | string | No | A screenshot to show instead of children. |
alt | string | No | – |
url | string | No | The address shown in the browser frame. |
frame | "dark" | "light" | No | Frame colour. Default "dark". |
time | string | No | The time in the status bar. Default "9:41". |
scroll | boolean | No | Let the screen scroll. Default true. |
orientation | "portrait" | "landscape" | No | Turn a phone or tablet sideways. Default "portrait". |
fill | boolean | No | Stretch the content to the screen's full height (for app screens with their own scrolling). Default false. |
children | React.ReactNode | No | – |
Dependencies
npm packages
clsxlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themeStates
All of them are drawn by the component. None is left for you to design.
- iPhone
- Android
- Tablet, landscape
- Browser
- Light frame
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances