# TerminalOutput

Process output that follows new lines (unless you’re selecting text), with a stop button.

- **Use it for**: Process output that follows along, with a stop button.
- **Not for**: Errors with frames. Try [StackTrace](https://unseenui.com/components/stack-trace/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { TerminalOutput } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<TerminalOutput variant="console" output={output} state={processState} command="pnpm test" onStop={requestStop} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` | Added to the root element, after the component's own classes. |
| `command` | `string` |  |
| `connection` | `"unknown" \| "connected" \| "reconnecting" \| "disconnected"` |  |
| `context` | `TerminalContext` |  |
| `error` | `string` |  |
| `exitCode` | `number` |  |
| `onClear` | `(() => void)` |  |
| `onRequestClear` | `((context: TerminalContext) => void)` |  |
| `onRequestStop` | `((context: TerminalContext) => void)` |  |
| `onStop` | `(() => void)` |  |
| `output` (required) | `string` |  |
| `renderOutput` | `((view: TerminalOutputRenderContext) => ReactNode)` | Trusted renderer composition; terminal output never supplies executable callbacks. |
| `state` (required) | `TerminalProcessState` |  |
| `status` | `TerminalAvailability` |  |
| `submission` | `SubmissionState` |  |
| `title` | `string` |  |
| `variant` | `"compact" \| "console" \| "log"` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[CodeTabs](https://unseenui.com/components/code-tabs/), [Snippet](https://unseenui.com/components/snippet/), [Commit](https://unseenui.com/components/commit/), [EnvironmentVariables](https://unseenui.com/components/environment-variables/), [PackageInfo](https://unseenui.com/components/package-info/), [SchemaDisplay](https://unseenui.com/components/schema-display/), [StackTrace](https://unseenui.com/components/stack-trace/), [WebPreview](https://unseenui.com/components/web-preview/), [Image](https://unseenui.com/components/image/), [FileExplorer](https://unseenui.com/components/file-explorer/), [CodeDiff](https://unseenui.com/components/code-diff/), [TestResults](https://unseenui.com/components/test-results/)

Page: https://unseenui.com/components/terminal-output/
