---
title: "Tool Result"
description: "Output that streams in, then folds into a result."
documentation: "https://beui.dev/react-native/tool-result"
markdown: "https://beui.dev/react-native/tool-result.md"
---

# Tool Result

> Output that streams in, then folds into a result.

React Native component for Expo, from beUI Native. Group: AI agents. Variants: 2.

## Install

Set up beUI Native once per app first: https://beui.dev/docs/native-setup.md

```bash
npx beui-native add tool-result
```

Or copy the source by hand and install its libraries:

```bash
npx expo install react-native-reanimated react-native-svg react-native-worklets
npm install uniwind tailwindcss
```

## Links

- Source: https://github.com/starc007/beui-native/tree/main/src/components/tool-result
- Registry JSON with every file: https://beui.dev/native/r/tool-result
- Open in Expo Go: exp://u.expo.dev/93a3a95c-6dc2-4adb-b57c-efbecf859f25/--/tool-result?runtime-version=exposdk%3A58.0.0&channel-name=production
- Web version: https://beui.dev/components/agents/tool-result.md

## README

### Tool Result

Native port of [beUI Tool Result](https://beui.dev/components/agents/tool-result): a tool call's output, streamed in while it runs.

```tsx
import * as Clipboard from "expo-clipboard";
import { ToolResult } from "./src";

<ToolResult
  tool="terminal.run"
  kind="terminal"
  title={running ? "Running tests" : "Tests passed"}
  status={running ? "running" : "success"}
  onCopy={() => Clipboard.setStringAsync(output)}
  onRetry={runAgain}
>
  {output}
</ToolResult>
```

#### Behavior

- String output renders in monospace; pass `ToolResultOutput` or any node for more control. `kind` picks the icon: `terminal`, `request` or `custom`.
- It's a card: a header with the kind's icon, the title, the tool name and a note, and a status pill (Running, Completed, Failed, Cancelled) that rolls as it changes.
- Without a `meta` note, the header times the run: it counts up while running and holds the final time, such as "4.1s". Pass `meta` for your own note, such as a status code.
- The output sits in an inset box, tinted red when the run fails. Its footer holds copy and run again, and counts the lines of string output.
- A thin bar slides along the card's bottom edge while it runs.
- It opens when a run starts and folds away when it finishes. Keep it open with `collapseOnComplete={false}`, or control it with `open`.
- Copy (when you pass `onCopy`) shows a check for 1600 ms. Run again appears with `onRetry`.

#### Better on a phone

- Output follows the newest line, but stops the moment you drag up to read and picks up again when you return to the end. The web version pulls you back on every line.
- The note and tool name sit on their own line under the title, so a phone-width header never truncates everything at once.

#### Accessibility

- The header reads as the title, note, tool and status, and reports whether the output is expanded.
- The output is a polite live region on Android, and the result is marked busy while running.
- Reduced motion, or `disableAnimation`, rolls and folds without movement and holds the spinner still.

Copy this directory, `primitives/running-bar.tsx`, `hooks/use-presence.ts`, `hooks/use-reduced-motion.ts`, `primitives/agent-icons.tsx`, `primitives/disclosure.tsx`, `primitives/roll-text.tsx`, `primitives/spin-glyph.tsx`, `styles/motion.ts`, and the semantic tokens in `styles/theme.css`. It uses `react-native-svg` for its icons.
