Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Tool
  3. Usage

Tool

Usage

Tool discloses one tool invocation: the tool's name and a status badge in the trigger, and its input, output and error in the region.
  • state takes a ToolState member or its string, so the state of a streamed tool part needs no conversion: input-streaming, input-available, output-available and output-error.
  • statusLabels holds the badge label for every state. Define it once and reuse it for every tool. The badge intent follows the state: informative, neutral, success and destructive.
  • input and output print as formatted JSON when they are not null or undefined; 0, false and "" are values. inputLabel and outputLabel are the headings above them.
  • errorText shows in the destructive color.
  • name is an identifier. It renders as code and reads left to right.
  • Closed by default. defaultOpen, open and onOpenChange control the state; details.cancel() keeps the current state.
  • Tool is a one-item line Accordion. The payload text wraps instead of scrolling.
  • The block is plain formatted JSON. When CodeBlock ships, Tool switches to it for highlighting and copy.
Previous
Tokenized Text / Accessibility
Next
Tool / API and Development