import { TerminalEventLine } from "@elabs-ai/components-terminal";npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminalPaste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.
Add the brand-ui TerminalEventLine component (from @elabs-ai/components-terminal) to this project. 1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`. 2. Look TerminalEventLine up before writing code: `npx -y @elabs-ai/components-cli docs TerminalEventLine` prints its real props, variants, what it pairs with and what to avoid. 3. If @elabs-ai/components-terminal is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminal` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminal`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`. 4. Use it here: [the screen or file, and what it should show] 5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop. 6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.
Avoid
- Importing AgentEvent or anything from `@elabs-ai/components-ai` — `terminal` and `ai` are layer-2 DAG siblings; the shared model lives in `@elabs-ai/components-ui` instead.
- Rendering the outcome word only when it is bad — `succeeded` gets the same glyph-plus-sr-only-word treatment as `blocked`/`failed`, never a silently unmarked default.
- Treating a `hooks` summary's `passed < ran` as merely informational — that mismatch is an independent failure signal (a distinct glyph plus an `sr-only` count), regardless of the row's own `outcome`.
- Renaming `hooks` to `checks` to match AgentEvent literally — the rendered vocabulary IS the literal upstream word "hooks", and this component's bracket is a terser summary, never AgentEvent's per-check breakdown list.
Works with
Pairs with
Avoid next to
Examples
Hooks Total Only
A bare hook total, when per-check verdicts are not known.
Hooks All Passed
All three hooks pass — the bracket renders plainly, no failure marker.
With Phase
When this event fired relative to the action it gates.
With Duration
A duration, formatted with the shared `formatElapsed`.
Blocked
A runtime hook refused the action — a distinct glyph and an announced "Blocked".
Failed
The event itself failed. Readable in greyscale: the outcome glyph's SHAPE changes (not only its colour), and the sr-only word differs from every other outcome.
Rail
`rail`/`boxed` pass through to the underlying `TerminalRow` like any other row.
Boxed
Transcript
The four real captured lines, together, reading top to bottom as one session.
API
TerminalEventLine
| Prop | Type | Description |
|---|---|---|
labelrequired | string | The runtime event name, verbatim as the runtime emits it — e.g. `"user_prompt_submit"`, `"pre_tool_use"`, `"stop"`. |
variant | TerminalVariant | Gutter grammar. Omitted, the row inherits the surrounding `TerminalSurface`. |
phase | AgentEventPhase | When this event fired relative to the action it gates. |
outcome | AgentEventOutcome | The event's verdict. @default "ok" |
durationMs | number | Wall-clock duration of the event, in milliseconds. Rendered with the shared `formatElapsed`. |
hooks | number | CheckSummary | Hook/gate-check count for this event: a bare total when per-check verdicts are not known, or a `{ran, passed}` summary once they are. Renders as the terminal's own `[hooks: …]` bracket vocabulary. A `passed < ran` summary is independently flagged as a failure — see the module doc. |
Theming
The tokens each state resolves to. Change the token and every theme follows.
| State | Token |
|---|---|
| hooksFailed | text-destructive-text |
| hooksOk | text-terminal-muted |