Thinking UI

Browser AgentPRO

A mini browser an agent is driving: the URL types itself, the cursor glides to targets, clicks ripple and every step lands in a log.

Code

4 files · 596 lines of TypeScriptPRO

Browser Agent is part of Pro

Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.

Motion notes

  • The target outline moves before the cursor arrives, so you see what the agent means to do a beat before it does it.
  • The click ripple waits for the cursor's elastic spring to land, so the press reads as the result of the movement, not a separate event.
  • Navigation types the URL out, then a hairline load bar runs and the new page cross-fades in. Following a link (typed: false) swaps the URL at once.
  • The log uses a container query: beside the window when there's room, under it when narrow. Older entries drift up under a mask instead of growing the card. With reduced motion, text appears whole and ripples are skipped.

Usage

Example
const actions: BrowserAction[] = [
    { type: "navigate", url: "https://acme.dev" },
    { type: "click", target: "nav-pricing" },
    { type: "type", target: "search", text: "pro plan" },
  ];

  <BrowserAgent actions={actions} current={step} done={finished} />

Props

PropTypeDefaultDescription
actionsBrowserAction[]—{ type: "navigate", url, typed? } | { type: "click", target } | { type: "type", target, text } | { type: "wait" }. Each takes an optional label for the log.
currentnumber—Index of the action in progress. Earlier actions read as done.
donebooleanfalseThe current action has finished too: no outline, past-tense log.
targetsBrowserTarget[]defaultBrowserTargets{ id, label, x, y, w, h, kind?: "link" | "button" | "input" | "card", placeholder? }. Boxes are in % of the page area.
imagestring—A screenshot to drive instead of the built-in skeleton page. Targets become invisible hit areas.
imageAltstring""Alt text for the screenshot.
childrenReactNode—Custom page content, drawn under the targets.
urlstring"about:blank"Address shown before the first navigate action.
agentNamestring"Agent"Label on the agent's cursor.
showLogbooleantrueShow the action log.
classNamestring—Classes for the outer container.