AI Chat Fancy Stable

WebSearch

A search the agent ran: the query in a search-bar header, an indeterminate scanning bar while it runs, and results that land one row at a time

Preview

Installation

pnpm add fancy-ui-svelte
import { WebSearch } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { WebSearch } from 'fancy-ui-svelte';
</script>

<WebSearch />

Examples

Basic Usage

Props

PropTypeDefaultDescription
query *string-What the agent looked up, shown in the search-bar header
results *SearchResultData[]-Hits found so far, oldest first; appending to it lands a new row
searching booleanfalseWhether the lookup is still running: drives the scanning bar and the waiting state
onSelect (result: SearchResultData, index: number) => void-Called when a row is activated; supplying it turns every row into a button
maxVisible number0Rows shown before the expander takes over; 0 shows every result
label string"Web search"Accessible name for the whole block

Slots

SlotDescription
itemReplaces the built-in row body, keeping the row element and its behaviour