工具结果

New

轻量执行披露:语法高亮的终端输出与请求响应、有界自动跟随、成功/错误/取消态,完成后折叠,支持复制与重试。

终端输出

tool-result.tsx

把命令输出流进有界视口并跟随新行,完成后折叠为运行摘要。

Running

API 参考

ToolResultOutput

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

ToolResult

tool
ReactNode
title
ReactNode
status?
"success" | "error" | "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

请求结果

tool-result.tsx

展示进行中的请求与高亮响应载荷,并提供重试与复制操作。

Preparing request…
Running

API 参考

ToolResultOutput

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

ToolResult

tool
ReactNode
title
ReactNode
status?
"success" | "error" | "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

安装

用 shadcn CLI 添加,或手动复制源码。

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

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.