iMac

A responsive iMac frame component that wraps any content inside a realistic iMac M4 display, with multiple sizes and colors.

imac-01

imac-02

imac-03

imac-04

imac-05

imac-06

Installation

pnpm dlx shadcn@latest add https://designali.com/r/imac.json

Usage

import { IMac } from "@/components/ui/imac"
<IMac>
  <div className="p-6">Your content here</div>
</IMac>

Size

<IMac size="lg">
  <div className="p-6">Large iMac</div>
</IMac>

Color

<IMac color="blue">
  <div className="p-6">Blue iMac</div>
</IMac>

Custom frame image

<IMac>
  <img
    src="/img/hero-1.jpg"
    alt="App screen"
    className="h-full w-full object-cover"
  />
</IMac>

Props

PropTypeDefault
childrenReactNode—
classNamestring—
size"sm" | "md" | "lg" | "xl""md"
color"blue" | "green" | "pink" | "silver" | "yellow" | "orange" | "purple""silver"

Notes

  • The screen area is an absolutely positioned container, so children scroll vertically inside it when they overflow.
  • Passing image overrides the color prop.
  • Sizes map to fixed widths (24rem, 32rem, 40rem, 52rem). Use className (for example max-w-full) to keep the iMac inside small viewports.