Skip to content
Haze UI

AI tool calls

Sequential chat tool-call trace with live per-step timers that collapses into a summary row above the final recommendation.

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

When to use

  • Streaming multi-step search, availability or filter tool calls inside an assistant reply
  • Collapsing finished tool logs into a single expandable summary line once the final answer arrives
  • Letting users inspect individual tool timings or replay the full execution sequence

When not to use

  • Pausing execution to request human permission before a tool runs; use ai-tool-approval
  • Showing an indeterminate loading shimmer without discrete tool steps; use ai-loading

Installation

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

pnpm dlx shadcn@latest add @haze/ai-tool-calls
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-tool-calls"Unique prefix for section heading IDs.
headingstring"Streaming tool calls"Card header title.
userPromptstring"Find a quiet boutique hotel in Porto for Nov 14–16 under €200"User question displayed above the tool trace.
stepsToolCallStep[]3 sequential hotel search stepsOrdered tool calls with labels, queries, durations and summary results.
classstring–Extra classes on the outer section.

Keyboard interactions

Tab
Move between the Replay button and the expandable tool summary header
EnterSpace
Toggle the tool-call trace list or replay the streaming sequence

Accessibility

  • Tool traces live inside a native details disclosure so keyboard and screen-reader users can expand or collapse finished steps at any time.
  • Reduced-motion preferences skip intermediate timer frames and settle immediately into the completed summary while announcing completion via role="status".

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 tool calls" with `npx shadcn@latest add @haze/ai-tool-calls`. 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 AiToolCalls from "@/components/haze/blocks/ai-tool-calls.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-tool-calls.md

  • Customize with real content

    Adapt the Haze ai-tool-calls block for our product. Replace the demo values of these props with our real content: id, heading, userPrompt, steps, class. Keep the layout, the heading level rules and these accessibility details: Tool traces live inside a native details disclosure so keyboard and screen-reader users can expand or collapse finished steps at any time. Reduced-motion preferences skip intermediate timer frames and settle immediately into the completed summary while announcing completion via role="status". Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using ai-tool-calls, check it fits: use it when streaming multi-step search, availability or filter tool calls inside an assistant reply; collapsing finished tool logs into a single expandable summary line once the final answer arrives; letting users inspect individual tool timings or replay the full execution sequence. Avoid it when pausing execution to request human permission before a tool runs; use ai-tool-approval; showing an indeterminate loading shimmer without discrete tool steps; use ai-loading. Alternatives: @haze/ai-loading, @haze/ai-tool-approval, @haze/agent-run.

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