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
| Prop | Type | Default | Description |
|---|---|---|---|
| actions | BrowserAction[] | — | { type: "navigate", url, typed? } | { type: "click", target } | { type: "type", target, text } | { type: "wait" }. Each takes an optional label for the log. |
| current | number | — | Index of the action in progress. Earlier actions read as done. |
| done | boolean | false | The current action has finished too: no outline, past-tense log. |
| targets | BrowserTarget[] | defaultBrowserTargets | { id, label, x, y, w, h, kind?: "link" | "button" | "input" | "card", placeholder? }. Boxes are in % of the page area. |
| image | string | — | A screenshot to drive instead of the built-in skeleton page. Targets become invisible hit areas. |
| imageAlt | string | "" | Alt text for the screenshot. |
| children | ReactNode | — | Custom page content, drawn under the targets. |
| url | string | "about:blank" | Address shown before the first navigate action. |
| agentName | string | "Agent" | Label on the agent's cursor. |
| showLog | boolean | true | Show the action log. |
| className | string | — | Classes for the outer container. |