# Tool Result

> Collapsible execution output for tools and terminal work.

Registry name: `tool-result`. HTML docs: https://ui.anuragroy.dev/component/tool-result.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/tool-result.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/tool-result.json`.

Registry JSON: https://ui.anuragroy.dev/r/tool-result.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/tool-result.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import {
  ToolResult,
  ToolResultHeader,
  ToolResultOutput
} from "@/components/ui/tool-result"
```

## Usage

```tsx
import {
  ToolResult,
  ToolResultHeader,
  ToolResultOutput,
} from "@/components/ui/tool-result"

export function Example() {
  return (
    <ToolResult status="success" defaultOpen>
      <ToolResultHeader status="success">npm run typecheck</ToolResultHeader>
      <ToolResultOutput>Found 0 errors.</ToolResultOutput>
    </ToolResult>
  )
}
```

## API

### ToolResult

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `status` | "running" \| "success" \| "error" | "success" |  |
| `defaultOpen` | boolean | — | Defaults to open unless status is `success`. |

## See also

- [HTML page](https://ui.anuragroy.dev/component/tool-result): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/tool-result.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
