Device

PreviousNext

A responsive device frame component for showcasing images or UI previews inside MacBook, iMac, iPhone, or iPad mockups.

device-imac

device-macbook

device-ipad

device-iphone

Installation

pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/device.json

Usage

import { Device } from "@/components/ui/device"
<Device variant="macbook" src="/screenshot.png" className="text-gray-900" />
<Device variant="imac" src="/screenshot.png" />
<Device variant="iphone" src="/mobile-preview.png" />
<Device variant="ipad" src="/tablet-preview.png" />

API Reference

Device

The main Device component. It renders a selected device frame and optionally displays an image inside it.

PropTypeDefaultDescription
variant"macbook" | "imac" | "iphone" | "ipad""macbook"Defines the device frame to render.
srcstringundefinedImage source URL to display inside the device screen.
...propsSVGProps<SVGSVGElement>Any additional props forwarded to the <svg> element.