Macbook

A responsive MacBook frame component that wraps any content inside a realistic MacBook Air, MacBook Pro or MacBook Neo display, with multiple sizes and colors.

macbook-01

macbook-02

macbook-03

macbook-04

macbook-05

Installation

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

Usage

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

Variant

<Macbook variant="macbook-pro" color="black">
  <div className="p-6">MacBook Pro</div>
</Macbook>

Size

<Macbook size="lg">
  <div className="p-6">Large MacBook</div>
</Macbook>

Color

<Macbook variant="macbook-air" color="sky-blue">
  <div className="p-6">Sky Blue MacBook Air</div>
</Macbook>

Custom frame image

<Macbook>
  <div className="p-6">Custom frame</div>
</Macbook>

Props

PropTypeDefault
childrenReactNode—
classNamestring—
variant"macbook-air" | "macbook-pro" | "macbook-neo""macbook-air"
size"sm" | "md" | "lg" | "xl""md"
color"sky-blue" | "midnight" | "starlight" | "silver" | "black" | "indigo" | "blush" | "citrus""silver"
"Macbook"

Available colors

VariantColors
macbook-airsky-blue, midnight, starlight, silver
macbook-problack, silver
macbook-neosilver, indigo, blush, citrus

Notes

  • The screen area is an absolutely positioned container, so children scroll vertically inside it when they overflow.
  • Sizes map to fixed widths (24rem, 36rem, 48rem, 64rem) with a 16/10 aspect ratio. Use className (for example max-w-full) to keep the MacBook inside small viewports.
  • If the selected color isn't available for the chosen variant, the first color of that variant is used. For example, variant="macbook-pro" with color="blush" falls back to black.
  • silver exists in all three variants, so the default works everywhere.
  • Passing image overrides both variant and color.