iPhone
An iPhone frame to show an app screen in.
Add it to your project
With the Magic UI commandTerminal
npx shadcn@latest add @magicui/iphone
First time with Magic UI? Set it up once.
The code
import type { HTMLAttributes } from "react"
const PHONE_WIDTH = 433
const PHONE_HEIGHT = 882
const SCREEN_X = 21.25
const SCREEN_Y = 19.25
const SCREEN_WIDTH = 389.5
const SCREEN_HEIGHT = 843.5
const SCREEN_RADIUS = 55.75
// Calculated percentages
const LEFT_PCT = (SCREEN_X / PHONE_WIDTH) * 100This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.