Kanshō

Docs / Sandbox and code /

BrowserPreview

Embedded preview of a URL or static HTML the agent generated, in an iframe shell.

Preview

🔐Sign in — My App
http://localhost:3000/login

Sign in to My App

you@example.com
••••••••
Continue

Variants

With content

🔐Sign in — My App
http://localhost:3000/login

Sign in to My App

you@example.com
••••••••
Continue

Empty placeholder

New Tab
http://localhost:3000
Preview content

Props

PropTypeDescription
urlstringDecorative URL shown in the address bar. Defaults to 'http://localhost:3000'.
pageTitlestringLabel shown in the browser tab strip.
faviconstringOptional emoji or single character used as the favicon.
childrenReact.ReactNodePreview content. When omitted, shows a 'Preview content' placeholder.
viewport"mobile" | "tablet" | "desktop"Controlled viewport size. The component has internal state when this prop is omitted.
onViewportChange(v: ViewportSize) => voidCalled when the viewport switcher changes.
minContentHeightstringMinimum height of the content area. Defaults to '320px'.
classNamestringAdditional class names for the root element.

Usage

import { BrowserPreview } from "@/components/sandbox/browser-preview";

<BrowserPreview
  url="http://localhost:3000/dashboard"
  pageTitle="Dashboard — My App"
  favicon="📊"
>
  <YourPageComponent />
</BrowserPreview>