Browser Window
A mock browser window for presenting UI previews, screenshots-as-code, or full page layouts in your documentation. It renders its children inside a browser-style frame with a URL bar and an optional zoom control — the current scale is displayed like in a real browser and readers can zoom in and out themselves.
Import
Code
Usage
Any content renders inside the browser frame.
Code
Scale
Use the scale prop to set the initial zoom of the content. This is useful for presenting
full-width layouts, like a landing page, at a reduced size. Passing a scale enables the zoom
control in the toolbar showing the current scale — readers can change it with the +/- buttons or
click the percentage to reset it, just like in a real browser. Without a scale, the zoom control
is hidden and the content renders at full size (pass scale={1} to start at 100% with the control
enabled).
The content is laid out at full width and scaled down to fit.
Code
Scaling affects layout, not just size: at scale={0.5} the content is laid out at twice the
container width and scaled down, so responsive layouts behave as if viewed on a larger screen.
URL
Set the url prop to change the address shown in the URL bar (defaults to localhost:3000):
Your developer portal
Code
Props
| Prop | Type | Description |
|---|---|---|
url | string | Address displayed in the URL bar. Defaults to localhost:3000. |
scale | number | Initial zoom of the content (e.g. 0.75 for 75%). Enables the zoom control; if omitted, the control is hidden and content renders at full size. |
className | string | Additional classes for the outer frame. |
contentClassName | string | Additional classes for the content viewport. |
children | ReactNode | The content rendered inside the browser window. |