# Browser Mockup

> React browser mockup: a window frame with traffic lights, an address bar and optional tabs around a screenshot or children, plus a matching PhoneMockup.

- Kind: Motion component (Landing pages)
- Docs: https://ui.minidev.pro/docs/browser-mockup
- Source (registry JSON with the full file): https://ui.minidev.pro/r/browser-mockup.json
- License: MIT. One file, yours to edit after install.

## When to use

Use it to frame product screenshots on landing pages, docs and changelogs. For several tilted frames at once use DeviceFrameStack.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/browser-mockup
```

Writes `components/ui/browser-mockup.tsx` and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/browser-mockup.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { BrowserMockup, PhoneMockup } from "@/components/ui/browser-mockup"
```

From the npm package:

```tsx
import { BrowserMockup } from "minidev-ui-kit/premium/browser-mockup"
```

## Usage

```tsx
import { BrowserMockup } from "@/components/ui/browser-mockup"

export function Example() {
  return (
    <BrowserMockup />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | `string` | `"https://app.lumen.dev/overview"` | no | Address shown in the URL bar. |
| `tabs` | `string[]` | `[]` | no | Tab labels. The strip is hidden when empty. |
| `activeTab` | `number` | `0` | no | Index of the active tab. |
| `src` | `string` | - | no | Screenshot to show instead of children. |
| `alt` | `string` | `""` | no |  |
| `appearance` | `"auto" \| "dark"` | `"auto"` | no | Stay dark in both themes, or follow the page theme. |
| `phone` | `boolean` | - | no | Render a PhoneMockup beside the window. Defaults to on for the built-in sample only. |
| `phoneContent` | `React.ReactNode` | - | no | Screen for the phone when `phone` is on. Defaults to the sample screen with no `src` or children, and an empty screen otherwise. |
| `children` | `React.ReactNode` | - | no |  |
| `className` | `string` | - | no |  |

## Examples

### Tabs and your own page

Children replace the sample dashboard; tabs adds a strip above the address bar with activeTab lit.

```tsx
<BrowserMockup url="https://app.lumen.dev/invoices/INV-2041" tabs={["Invoices", "Customers", "Reports"]} activeTab={0}>
  <div className="space-y-4 p-6">
    <div className="flex flex-wrap items-start justify-between gap-3">
      <div>
        <p className="font-mono text-xs text-fg-subtle">INV-2041</p>
        <p className="text-lg font-medium tracking-[-0.01em] text-fg">Northwind Traders</p>
      </div>
      <Badge variant="accent">Paid</Badge>
    </div>
    <div className="grid gap-3 sm:grid-cols-3">
      {[["Amount", "$4,200.00"], ["Issued", "Sep 12, 2026"], ["Paid", "Sep 30, 2026"]].map(([k, v]) => (
        <div key={k} className="rounded-lg border border-border bg-surface p-3">
          <p className="text-xs text-fg-muted">{k}</p>
          <p className="mt-0.5 text-sm font-medium text-fg tabular-nums">{v}</p>
        </div>
      ))}
    </div>
  </div>
</BrowserMockup>
```

### Dark window, no phone

appearance dark keeps the window dark in both themes; phone false drops the handset from the sample.

```tsx
<BrowserMockup appearance="dark" phone={false} />
```

### Phone on its own

PhoneMockup ships in the same file; width sets the handset size and time the clock in the status bar.

```tsx
<PhoneMockup time="10:24" width={260}>
  <div className="space-y-3 px-4 pt-2">
    <p className="text-xs text-fg-muted">Today</p>
    <div className="rounded-xl border border-border bg-surface p-3 shadow-raised">
      <p className="text-xs font-medium text-fg">INV-2041 paid</p>
      <p className="mt-0.5 text-[11px] text-fg-muted">Northwind Traders sent $4,200.00</p>
    </div>
    <div className="rounded-xl border border-border bg-surface p-3 shadow-raised">
      <p className="text-xs font-medium text-fg">Reminder scheduled</p>
      <p className="mt-0.5 text-[11px] text-fg-muted">INV-2042 to Theo Okafor, Friday 9:00</p>
    </div>
    <div className="rounded-xl border border-border bg-surface p-3 shadow-raised">
      <p className="text-xs font-medium text-fg">New customer</p>
      <p className="mt-0.5 text-[11px] text-fg-muted">Priya Raman joined from your invite link</p>
    </div>
  </div>
</PhoneMockup>
```

## Accessibility

- `alt` defaults to `""`, so a screenshot is decorative unless you describe it. Write an `alt` when the image carries information the page text does not.
- Traffic lights, browser buttons, the lock icon, the phone's side buttons, status bar and dynamic island are all `aria-hidden`.
- The built-in sample dashboard is real markup with its own `<main>` and `<aside>`, so it adds a second main landmark to your page. Use `src` or children in production.
- The active tab gets `aria-current="page"`; tabs are plain text, not controls.

## FAQ

### How do I put my own screenshot or live component in the browser frame?

Pass `src` (and `alt`) for an image, or children for live UI; with neither, the frame shows the built-in Lumen dashboard and a phone beside it. Set `phone` to `false` to drop the phone. With your own content, `phone` is off by default; turn it on and pass `phoneContent` for the handset's screen, or the phone shows an empty screen.

### Can the mockup stay dark on a light page?

Yes. `appearance="dark"` adds the `dark` class to the frame (or to the whole scene when the phone shows), so it uses dark tokens in both themes. The default `"auto"` follows the page.

### How do I show only a phone?

Import `PhoneMockup` from the same file: `<PhoneMockup width={260} src="/mobile.png" alt="Lumen home screen" />`. Height follows a 9:19.5 screen, and `time` sets the status bar clock.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`

## Related

- [Device Frame Stack](https://ui.minidev.pro/docs/device-frame-stack/md): Three device frames labelled mobile, app and docs that spring into a fanned, rotated stack when scrolled into view. Works as a hero or feature visual.
- [Aspect Ratio](https://ui.minidev.pro/docs/aspect-ratio/md): Shadcn compatible aspect ratio wrapper that locks media to a ratio such as 16:9 or 1:1 using CSS aspect-ratio, with overflow clipped for images and video.
- [Window Chrome](https://ui.minidev.pro/docs/window-chrome/md): A macOS style window frame for React with three traffic light dots, a truncated title bar and a padded content area for framing demos and screenshots.
- [Hero Split Showcase](https://ui.minidev.pro/docs/hero-split-showcase/md): A split hero with headline and copy on the left and a product card on the right whose bar chart grows into place on load. Suits launch and docs homes.
- [Product Os Mock](https://ui.minidev.pro/docs/product-os-mock/md): A mock product interface that auto cycles through inbox, pipeline and agents views with animated rows and progress bars. Click the sidebar to switch.
- [Agency Portfolio](https://ui.minidev.pro/docs/agency-portfolio/md): An agency portfolio page with a marketing navbar, animated headline, project cards that fade up in sequence as they scroll in, and a mega footer.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
