AI Components/ToolCallViewer

ToolCallViewer

Collapsible UI for displaying AI tool calls — shows the tool name, arguments, result, and status. Great for AI playground or agent transparency UIs.

import { ToolCallViewer } from "@animui/ui"

Basic

donesearch_web
{
  "results": [
    {
      "title": "Steal Shadow",
      "url": "github.com/..."
    }
  ]
}

Multiple tool calls

Map over tool calls from your AI SDK and render each as a ToolCallViewer.

doneread_file
{
  "content": "import React from 'react'…"
}
runningsearch_web
errorwrite_file

Streaming integration

streaming-example.tsx
import { ToolCallViewer } from "@animui/ui";

export default function StreamingExample() {
  const [calls] = useToolCalls(); // from your AI SDK

  return (
    <div className="space-y-2">
      {calls.map((call) => (
        <ToolCallViewer
          key={call.id}
          name={call.name}
          args={call.args}
          result={call.result}
          status={call.status}  // "pending" | "running" | "done" | "error"
        />
      ))}
    </div>
  );
}

Props

PropTypeDefaultDescription
namestringName of the tool being called (displayed in the header).
argsRecord<string, unknown>Arguments passed to the tool, rendered as formatted JSON.
resultunknownThe tool's return value, rendered as formatted JSON.
status"pending" | "running" | "done" | "error""pending"Current execution state of the tool call.
classNamestringAdditional classes for the wrapper.
© 2026 Steal Shadow. MIT License.Report an issue