# Terminal Frame

> A terminal that types its commands and prints their output.

For install steps, CLI products and developer docs: the commands type themselves once seen, the output follows, and Copy takes the commands only.

- Family: Chrome
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/terminal-frame/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add terminal-frame
```

It installs to `components/galactrex/terminal-frame.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { TerminalFrame } from "@/components/galactrex/terminal-frame";

<TerminalFrame lines={[
  { kind: "input", text: "npx @galactrex/ui add border-beam" },
  { kind: "output", text: "✔ Done." },
]} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `lines` | `{ kind: "input" \| "output"; text: string }[]` | — | The session, in order. |
| `title` | `ReactNode` | `"terminal"` | Window title. |
| `prompt` | `string` | `"$"` | Prompt before input lines. |
| `speed` | `number` | `38` | Characters typed per second. |
| `pause` | `number` | `280` | Ms after each line. |
| `start` | `"inView" \| "mount"` | `"inView"` | When typing starts. |
| `copyable` | `boolean` | `true` | Show a Copy button for the commands. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Install.** One command, one line of output.
- **Session.** Several commands with output between them.

## Accessibility

- The whole transcript is in the document as text from the start; the typing is aria-hidden.
- Copy and Replay are real buttons with visible focus.

## Motion

- Typing writes text only; no layout animation.
- Reduced motion: the full transcript shows at once and Replay is hidden.
