Web Search Results

The pages an agent is searching and reading, live, folding to one line when done.

PROGet Web Search Results and 168 other Pro components with pro lifetime — Get Pro

Category
AI Agent
Access
Pro
Source
281 lines · one file
States
5 drawn

The decision inside it

A failed page stays in the list

The reader should know the agent tried the paywalled source and could not get in. Dropping it would make the answer look better sourced than it is.

When to use it

Use Web Search Results while an agent searches the web and reads pages: each page shows queued, reading, read or failed, and the list folds to one line when the search is done. Update results and status as your agent streams events.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Web Search Results for this.
Install it: npx shadcn@latest add @liro/web-search-results
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/web-search-results.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/agent-search.tsx
import { WebSearchResults, type SearchResult } from "@/components/ui/web-search-results";

export function AgentSearch({ query, results, done }: { query: string; results: SearchResult[]; done: boolean }) {
  return <WebSearchResults query={query} results={results} status={done ? "done" : "reading"} maxVisible={5} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
querystring YesWhat was searched for, as the agent typed it.
resultsSearchResult[] YesThe pages found so far.
status"searching" | "reading" | "done" | "error" NoThe search as a whole. Default "reading".
maxVisiblenumber NoRows shown before "+N more". Default 5.
variant"default" | "compact" No"compact" drops snippets and tightens rows, for a narrow chat column. Default "default".
onResultClick(result: SearchResult) => void NoCalled when a row is pressed. Without it, rows are links that open in a new tab.
defaultExpandedboolean NoStart with the list open even when done. Default false: a finished search folds to one line.
lookLook NoLayered rests the list in a tray with the totals in the strip below. Flat is one card. Default layered.

Dependencies

npm packages

clsxlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-theme

States

All of them are drawn by the component. None is left for you to design.

  • Searching
  • Reading
  • Done
  • Failed page
  • Compact

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances

Used in a screenAll screens