Skip to content

Browser Mockup

Motion

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

src/registry/premium/browser-mockup.tsx/r/browser-mockup.json

Installation

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

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/browser-mockup.json

Usage

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

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

Exports BrowserMockup PhoneMockup

API reference

BrowserMockup props
PropTypeDefault
urlAddress shown in the URL bar.string"https://app.lumen.dev/overview"
tabsTab labels. The strip is hidden when empty.string[][]
activeTabIndex of the active tab.number0
srcScreenshot to show instead of children.string-
altstring""
appearanceStay dark in both themes, or follow the page theme."auto""dark""auto"
phoneRender a PhoneMockup beside the window. Defaults to on for the built-in sample only.boolean-
phoneContentScreen for the phone when `phone` is on. Defaults to the sample screen with no `src` or children, and an empty screen otherwise.React.ReactNode-
childrenReact.ReactNode-
classNamestring-

When to use

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

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.

Frequently asked questions

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.

Dependencies

npm

lucide-react

Built from

No other MiniDev files

Examples

Tabs and your own page

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

Dark window, no phone

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

Phone on its own

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

All Landing page sections for React and Tailwind