# StackTrace

A readable error with internal frames collapsed.

- **Use it for**: A readable error with internal frames collapsed.
- **Not for**: Process output. Try [TerminalOutput](https://unseenui.com/components/terminal-output/).

## Installation

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

## Usage

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

<StackTrace name="TypeError" message={message} frames={frames} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` |  |
| `frames` (required) | `readonly StackFrame[]` |  |
| `headingLevel` | `3 \| 2 \| 4 \| 5 \| 6` |  |
| `labels` | `Partial<StackTraceLabels>` | Replaces the built-in wording, for example to translate it. |
| `message` (required) | `string` |  |
| `name` (required) | `string` |  |
| `onOpenFrame` | `((frame: StackFrame) => void)` | Opens a frame's source in the host's editor. |

## 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/), [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/), [TerminalOutput](https://unseenui.com/components/terminal-output/), [TestResults](https://unseenui.com/components/test-results/)

Page: https://unseenui.com/components/stack-trace/
