Skip to main content

TerminalEventLine

Transcriptterminal

The CLI dress of an agent lifecycle/hook event line: a fixed marker glyph, a label, and an optional phase/hook-count/duration, sharing AgentEvent's outcome and hook-count model so the two skins stay in sync.

import { TerminalEventLine } from "@elabs-ai/components-terminal";
Install
npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminal

Skipping the @source line is the most common first failure: Tailwind does not scan node_modules, so every component renders unstyled. The one-time wiring

Prompt for your coding agent

Paste 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

  • AgentEvent (that is the chat skin of the same model, not a row sibling)

Examples

10 live 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

PropTypeDescription
labelrequiredstringThe runtime event name, verbatim as the runtime emits it — e.g. `"user_prompt_submit"`, `"pre_tool_use"`, `"stop"`.
variantTerminalVariantGutter grammar. Omitted, the row inherits the surrounding `TerminalSurface`.
phaseAgentEventPhaseWhen this event fired relative to the action it gates.
outcomeAgentEventOutcomeThe event's verdict. @default "ok"
durationMsnumberWall-clock duration of the event, in milliseconds. Rendered with the shared `formatElapsed`.
hooksnumber | CheckSummaryHook/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.

Also accepts: Omit<HTMLAttributes<HTMLDivElement>, "children">

Theming

The tokens each state resolves to. Change the token and every theme follows.

StateToken
hooksFailedtext-destructive-text
hooksOktext-terminal-muted