Tool Call

What an assistant's tools did, one past-tense row each ("Searched the web · 8 sources"), opening to what they read; several fold under one line.

3 tool calls · 3 sources
Searching messages

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/tool-call

Usage

import { type ToolCall, ToolCalls } from "./ui/uicontext/components/kit/ToolCall.ts"
export const AnswerTools = <M>(h: Html.H<M>, calls: ReadonlyArray<ToolCall>, answer: string) =>	ToolCalls(h, { calls, key: answer })

API reference

Options

ToolCalls options
NameTypeDescription
callsrequiredToolCall[]—
keystringNames this list's rows among others in the same view
labelstringThe list's accessible name; "Tool calls" by default

Accessibility

  • Each call is a native disclosure: Enter or Space on its row shows the sources it read, each a link that opens in a new tab.
  • A running call's words are a polite live region, so the change from “Searching” to “Searched” is heard once, not every frame.
  • The sweep of light over a running call stops under reduced motion; the words still say it's running.

Source