Motion
PreviousNext

Device Mockup

An animated mockup to switch and render macOS, iPhone and Android devices.

Kit

Installation

Usage

import {
    Camera,
    DeviceContent,
    DeviceSelector,
    Keyboard,
    MobileButtons,
    MutableDeviceMockupRoot,
    Screen,
    TopBar,
    Viewport,
} from '@kit/ui/motion/mutable-device-mockup';
<MutableDeviceMockupRoot defaultDevice="ios" toggleDeviceOnClick> <DeviceSelector /> <Viewport origin="top" className="aspect-678/409 w-full"> <Screen> <Camera /> <TopBar /> <MobileButtons /> <DeviceContent visibleIf={'desktop'} className="flex items-center justify-center pb-0" visibleAfter={5} > {/* Desktop content */} </DeviceContent> <DeviceContent visibleIf={['android', 'ios']} className="flex items-center justify-center pb-0" > {/* Android and iOS content */} </DeviceContent> </Screen> </Viewport> <Keyboard /> </MutableDeviceMockupRoot>

Features

  • MacOS, iPhone and Android mockups.
  • Animated transitions.
  • Powered by motion library
  • Radix components architecture.

API Reference

Root

MutableDeviceMockupRootProps

PropTypeDefault
config
DeviceConfig
device
"desktop" | "ios" |...
defaultDevice
"desktop" | "ios" |...
toggleDeviceOnClick
boolean
cropTop
boolean
onDeviceChange
function
children*
React.ReactNode

Selector

DeviceSelectorProps

PropTypeDefault
itemClassName
string
activeItemClassName
string
items
Record<"desktop" | "ios" | "android", { className?: string; content?: React.ReactNode; }>

Viewport

PropTypeDefault
width
string | number
height
string | number
className
string
origin
"top" | "bottom" | "center"...
children
React.ReactNode

Screen

The screen of all the devices.

React.PropsWithChildren

Keyboard

The macOS keyboard.

MacOSTopBar

MacOSTopBarProps

PropTypeDefault
icon
"scale" | "x" |...
app
string

IOSTopBar

The top bar on iOS devices.

AndroidTopBar

The top bar on Android devices.

AppleTopCamera

The top camera on macOS and iOS devices.

AndroidFloatingCamera

The floating camera on Android devices.

PowerButton

The power button on mobile devices.

IOSButtons

Add mobile buttons according an iOS layout.

AndroidButtons

Add mobile buttons according an Android layout.

DeviceContent

DeviceContentProps

PropTypeDefault
visibleIf*
"desktop" | "ios" |...
visibleAfter
number
container
HTMLMotionProps<"div">

Shortcut components

Use this components to avoid the pain of handling all the previous components.

MobileButtons

Add mobile buttons according an iOS or Android layout.

TopBar

Add the top bar according an macOS, iOS or Android layout.

Camera

Add the camera according an macOS, iOS or Android layout.

MutableDeviceMockup

The main component to render the device mockup.

Takes the same props as Root : MutableDeviceMockupRootProps.

How is this guide?

Last updated on 10/17/2025