Skip to content
Haze UI

AI search composer

Grounded AI search bar with a tool switcher, run-limit indicators, active tool pill, live source reading trace and cited summary.

pnpm dlx shadcn@latest add @haze/ai-input-search
Open preview in a new tab
Livesmall script

When to use

  • Offering an AI answer bar that shows which live sources are being read before summarizing
  • Letting users toggle specialized search tools with visible quota dot indicators
  • Pairing a prompt input with clickable citation cards and a stoppable search trace

When not to use

  • You need instant local keyword filtering across static workspace records; use ai-search-bar instead
  • You do not need source verification or tool selection; use ai-prompt instead

Installation

Add the Haze registry to components.json once, then install AI search composer with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/ai-input-search
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
idstring"haze-ai-input-search"Unique prefix for form labels and tool menu controls.
headingstring"Answers with links you can check"Header hint shown in the outer search tray.
placeholderstring"Look something up"Placeholder text inside the search textarea.
initialQuerystring""Optional pre-filled query inside the search box.
tools{ id: string; label: string; description: string; remaining: number; limit: number }[]5 demo toolsTools displayed in the Change / menu with quota dots.
modelsstring[]["Sonnet 5.5", "Opus 5.5", "Flash 4.0"]Model options available in the toolbar selector.
sources{ initials: string; title: string; domain: string; href: string; snippet: string }[]4 demo sourcesSource entries stacked during the live trace and linked below.
classstring–Extra classes on the outer section.

Keyboard interactions

Tab
Move across the Change / menu trigger, active tool pill, query field, controls and citation links
EnterSpace
Toggle the tool menu, choose a tool, remove pills, attach files or start and stop a search

Accessibility

  • The tool switcher exposes aria-expanded and aria-controls, while run-limit dot rows carry readable aria-label quota counts.
  • Tool changes, file attachments, source reading progress and stop actions announce via a polite role="status" region.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI block "AI search composer" with `npx shadcn@latest add @haze/ai-input-search`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import AiInputSearch from "@/components/haze/blocks/ai-input-search.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/ai-input-search.md

  • Customize with real content

    Adapt the Haze ai-input-search block for our product. Replace the demo values of these props with our real content: id, heading, placeholder, initialQuery, tools, models, sources, class. Keep the layout, the heading level rules and these accessibility details: The tool switcher exposes aria-expanded and aria-controls, while run-limit dot rows carry readable aria-label quota counts. Tool changes, file attachments, source reading progress and stop actions announce via a polite role="status" region. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using ai-input-search, check it fits: use it when offering an ai answer bar that shows which live sources are being read before summarizing; letting users toggle specialized search tools with visible quota dot indicators; pairing a prompt input with clickable citation cards and a stoppable search trace. Avoid it when you need instant local keyword filtering across static workspace records; use ai-search-bar instead; you do not need source verification or tool selection; use ai-prompt instead. Alternatives: @haze/ai-search-bar, @haze/ai-prompt, @haze/ai-citations.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog