Installation
Copy and paste the following code into your project.
'use client';
import { cn } from '@kit/shared';
import { AnimatePresence, HTMLMotionProps, motion, type TargetAndTransition } from 'framer-motion';
import {
BluetoothConnected,
LucideProps,
LucideSignal,
LucideSignalLow,
LucideWifi,
Update the import paths to match your project setup.
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
Prop | Type | Default |
---|---|---|
config | DeviceConfig | |
device | "desktop" | "ios" |... | |
defaultDevice | "desktop" | "ios" |... | |
toggleDeviceOnClick | boolean | |
cropTop | boolean | |
onDeviceChange | function | |
children* | React.ReactNode |
Selector
DeviceSelectorProps
Prop | Type | Default |
---|---|---|
itemClassName | string | |
activeItemClassName | string | |
items | Record<"desktop" | "ios" | "android", { className?: string; content?: React.ReactNode; }> |
Viewport
Prop | Type | Default |
---|---|---|
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
Prop | Type | Default |
---|---|---|
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
Prop | Type | Default |
---|---|---|
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
.
Add a glowing effect to your components.
A simple hook to copy to clipboard.
How is this guide?
Last updated on 10/17/2025