Tool Result

A lightweight execution disclosure for syntax-highlighted terminal output and request responses that collapses into a compact completed state.

Terminal Output

tool-result.tsx

Streams command output into a bounded viewport, follows new lines, then collapses into the completed run summary.

Running

Request Result

tool-result.tsx

Presents an in-flight request and its highlighted response payload with retry and copy actions.

Preparing request…
Running

API Reference

ToolResultOutput

language?
"text" | "bash" | "diff" | "json" | "tsx" | "typescript"
bash
className?
string

ToolResult

tool
ReactNode
title
ReactNode
status?
"error" | "success" | "running" | "cancelled"
running
kind?
"custom" | "terminal" | "request"
custom
meta?
ReactNode
icon?
ReactNode
open?
boolean
defaultOpen?
boolean
true
onOpenChange?
((open: boolean) => void)
collapseOnComplete?
boolean
true
maxHeight?
number
220
copyText?
string
onCopy?
(() => void | Promise<void>)
onRetry?
(() => void)
className?
string
contentClassName?
string

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/tool-result

Composition

Use the output primitive for terminal text, request details, generated code, or another structured result.

ToolResult
└── ToolResultOutput

Note: Tool Approval collects permission before the execution begins. Code Block renders highlighted code returned by a tool. Agent Activity summarizes the tool invocation within a longer run.

How it works

A tool result is evidence from an execution, not another chat bubble. It should connect a compact run summary to the output needed for inspection, recovery, or reuse.

Updated