OfferLifetime Pro for $99

Web Search Results

The query, then each page found with its own state: queued, reading, read or failed. Past a few rows the rest go behind "+7 more", and when the search is done it folds to "Read 7 pages from 5 sites" with the site logos.

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 Layro's Web Search Results for this.
Install it: npx shadcn@latest add @layro/web-search-results
(the @layro registry is set up in components.json, with LAYRO_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 @layro 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.

PropTypeNotes
queryrequiredstringWhat was searched for, as the agent typed it.
resultsrequiredSearchResult[]The pages found so far.
status"searching" | "reading" | "done" | "error"The search as a whole. Default "reading".
maxVisiblenumberRows shown before "+N more". Default 5.
variant"default" | "compact""compact" drops snippets and tightens rows, for a narrow chat column. Default "default".
onResultClick(result: SearchResult) => voidCalled when a row is pressed. Without it, rows are links that open in a new tab.
defaultExpandedbooleanStart with the list open even when done. Default false: a finished search folds to one line.
lookLookLayered 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

Layro foundations, installed alongside it

layro-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

Lifetime access

Every component, and everything we ship next.

  • All 232 components, source included
  • Every template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.