For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.0/en/components/tool-result.md.

Tool Result

Tool Result presents the primary result, diagnostics, and structured metadata for a completed call in one switchable region. Use it when the output has distinct peer views that people need to compare. A one-line success message stays in the Tool Call summary.

Test run result
Permission boundary tests Passed
18 tests passed0 failed2.84 sExit code 0
PASS tests/policy.spec.ts
PASS tests/permission-boundary.spec.ts

Test Suites  2 passed (2)
Tests        18 passed (18)

Information architecture

The first tab is the view most useful for making a decision, not mechanically stdout. Tabs are peer representations of one result, such as summary, output, diff, preview, and metadata. Retry, download, and open-file commands belong in the header action region.

Loading, empty, and error states retain the result identity and status. An error view explains the cause and exposes a recovery action instead of rendering an empty Output tab. Use a dedicated previewer or download link for binary assets, images, and very large files rather than mounting the whole resource in the DOM.

Controller and states

Tool Result reuses Tabs select(tab, focus) and refresh() methods and emits the same cancelable transition events. Root state is ready, loading, empty, or error. The selected tab is an internal view state and cannot replace whether the result itself is available.

Accessibility

Each tab and panel pair must have matching aria-controls and aria-labelledby values. Arrow keys, Home, and End move within the tablist. Inactive tabs use tabindex="-1"; inactive panels use native hidden. Header status, result counts, and exit codes have text equivalents and never depend on green or red alone.