WebSocket endpoint returned by agent-browser. Frames and user input travel over this connection.
Browser
A composable React viewport for agent-browser. Stream a real session, visualize agent actions and hand control to a person without changing transports.
pnpm add @browser-ui/reactDemo
Find Mac mini, configure the desktop and a Studio Display, then hand the live session back at Apple’s final review.
Usage
Pass the stream URL from your agent-browser session and the small amount of state your application already owns.
import { Browser } from "@browser-ui/react";
type AgentBrowserProps = {
streamUrl: string;
operating: boolean;
action?: string;
onTakeControl: () => void;
};
export function AgentBrowser({
streamUrl,
operating,
action,
onTakeControl,
}: AgentBrowserProps) {
return (
<Browser
streamUrl={streamUrl}
viewportSize={{ width: 1440, height: 900 }}
operating={operating}
operatingLabel={action}
showPictureInPicture
showFullscreen
onTakeControl={onTakeControl}
/>
);
}
Props
The composed API stays controlled where product behavior matters and provides sensible defaults for presentation.
Stream
Remote browser resolution, independent from the rendered component. Keep it fixed to preserve desktop breakpoints in PiP.
Shape of the rendered component only. It never changes the remote viewport.
Controls Browser UI chrome independently from the streamed page. System follows the host device preference.
Reports navigation messages emitted by the remote browser.
Reports the requested remote viewport dimensions to the session owner.
Reports connecting, connected, disconnected and error states.
Agent activity
Shows the activity shader and pauses direct viewport input while the agent owns the session.
Current action displayed in the compact status control.
Normalized cursor position and pressed or typing state for visualizing live or recorded agent actions.
Controls the rendered cursor width in CSS pixels.
Controls the soft radial glow beneath the cursor.
Called when the person stops the workflow and takes ownership of browser input.
Copy shown while the WebSocket is connecting or reconnecting.
Display
Use the standalone glass frame or an unstyled edge-to-edge surface.
Adds the optional address and reload controls.
Adds the floating picture-in-picture control.
Adds application fullscreen without changing the remote viewport size.
Constrains fullscreen to a host element and tracks its bounds and border radius.
Controls the display mode from your application.
Initial display mode when Browser manages its own state.
Reports transitions between inline, PiP and fullscreen.
Navigation
Current URL shown by the optional controls.
Receives address submissions so the session owner can navigate agent-browser.
Receives reload requests from the optional browser controls.
Accessible name for the interactive remote viewport.
Class name applied directly to AgentBrowserViewport.