Skip to content

Device Frame

Free

The parts to build your own device mockup: a frame that scales to its box, the hardware picture, and a screen at its real size.

  • React 19
  • Tailwind CSS 4

Added Nov 10, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Give the frame the box, the finish, and the screen place, then draw the body.

kiosk-frame.tsx

DeviceFrame

<figure>
PropTypeDefaultDescription
boxRequired—The figure box in pt: the body plus the keys that stand out of it (insetBox).
finishRequired—The colors of the finish, written as --device-<key in kebab case> on the root.
screenRequiredDeviceScreenPlace—Where the screen sits on the stage, written as --device-screen-* and --safe-area-*.
...props<figure> attributes—Every other attribute goes to the <figure>, with a ref.

DeviceFrameHardware

<div>
PropTypeDefaultDescription
bodyRequired—The body size in pt, before a turn.
insetRequired—The space the keys take around the body on the stage: the body sits left and top in.
turn"left""right"—A quarter turn of the body: left (rotate(-90deg), the right side goes to the top) or right (rotate(90deg)). Pair it with turnInset for inset.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DeviceFrameDisplay

<div>
PropTypeDefaultDescription
platform"android""apple""windows"—The platform whose system font the screen and its status bar take (deviceFontVariants): app content inside the screen inherits it. Each device sets its own.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DeviceFrameScreen

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it when no device of the Mockups category fits, for example a kiosk or a game handheld.
  • Give box the body plus the keys that stick out, so a full-width frame never scrolls the page.
  • Make the screen corner the body corner minus the bezel, so the corners are concentric.

DeviceFrameHardware is hidden from screen readers. Give the root an aria-label, so the figure has a name.

  1. AddedDevice Frame.
Open the release