Skip to content

Device Frame

A laptop with a notch and a phone, drawn in CSS with no device images or marks, to show a product running inside them. The screen is a positioned slot, so a Notch Island glues to its top edge.

On this page
Used for
  • Hero for a desktop app
  • Phone app screens
  • Product video frames
  • Notch and island demos

Examples

Opens as you scroll

External display

Phone

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

LaptopFrame children
ReactNode
The screen content, clipped to the 16:10 screen.
menuBar
{ left?, right? }
A 32px bar across the top of the screen, under the overlay.
overlay
ReactNode
Drawn on top of the screen, e.g. a NotchIsland.
bare
boolean
Defaultfalse
Hide the hinge and base, for a crop of the screen.
reveal
"scroll"
The laptop is the 3D model and its lid opens around the hinge as the frame scrolls into view. Transform only, never takes over the scroll; open and still with reduced motion or ?still=1.
open
number
The 3D model with the lid this open, 0 shut (its back on the deck) to 1 upright. Ignored with reveal.
angle
number
The lid angle in degrees instead: 0 upright, negative closing toward you, positive leaning back.
screen
"content" | "glass"
Default"content"
glass: the screen asleep, dark glass with the notch lit in the accent.
mark
ReactNode
A faint mark on the back of the lid, seen while it is shut. Your own mark only.
onOpen
() => void
Called once when the lid is fully open, to start what plays on the screen.
Laptop3D
children, overlay, open, angle, screen, mark, badge
The one laptop model the frame and LaptopScroll use: a 16:10 lid on a deck of the same width, with speaker grilles, a full keyboard of small backlit caps and a trackpad. 680 by 553px; zoom it to fit.
LaptopScroll
title, children, overlay, mark, onProgress, onOpen
A 180vh section whose stage sticks under the header: the laptop opens over the first 40%, holds while onProgress scrubs the screen, then settles. Fitted to the window by width and height.
DisplayFrame children / overlay
ReactNode
An external display: thin bezel, 16:9 panel, neck and foot.
PhoneFrame children / overlay
ReactNode
The same slots for the phone. Its width is up to 360px.
className / screenClassName
string
On the frame and on the screen.

Accessibility

  • The frame is decoration: it adds no role or name, and the hinge is hidden from screen readers.
  • What you put on the screen keeps its own semantics. A screenshot-like demo should be aria-hidden, as the desktop here is.

What it handles

  1. 01Draws a laptop (bezel, 16:10 screen, hinge and base), an external display and a phone in CSS, with no device images or marks.
  2. 02Opens the laptop lid as it scrolls into view, transform only, from a scroll-driven animation or a passive scroll listener; it never pins the page.
  3. 03Scales with its width, so the same frame works in a hero, a feature row and a phone layout.
  4. 04Gives the screen a positioned slot: a Notch Island or any overlay placed at its top sits where the hardware would be.
  5. 05Adds an optional menu bar 32px tall, the height of a notch's ears.
  6. 06Reads in light and dark: the body stays dark, the edge gets a hairline on a dark page.

States

First render
Nothing moves. The frame is still
none
Scrolling in (reveal)
The lid swings open around the hinge and the screen scales up
follows the scroll, linear
Reduced motion
The lid is open and still; what plays inside is up to your content
0ms

Works with

When to use

When to use

  • A hero for a desktop or phone app: your real screen inside a laptop with a notch or a phone, no device photos.
  • A feature row that shows one state of the app big, cropped to the top of the screen.

When not to use

  • A browser window around a screenshot: use Hero.
  • The live shape at the top of the screen on its own: use Notch Island.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Device Frame to my app and wire it to my own data.
  • I need a hero for a desktop or phone app: your real screen inside a laptop with a notch or a phone, no device photos. Set that up with the Knowns UI Device Frame.
  • Which Device Frame props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "device-frame" }) and search_docs({ query: "device frame" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Device Frame, or found something off? We read every message.