Terminal renders the terminal transcript: a
focusable <div class="talos-terminal" role="region"> of
.talos-terminal__line rows. Pass lines for a static transcript, or put
.talos-terminal__line elements in the default slot (for lines a script
appends). Command lines draw the prompt glyph as generated content, so copying
a command copies only the command. The CSS lives in talos-terminal.css (in
all.css); see the Terminal CSS page for the
class reference.
Default
PREVIEW
bun run build
dist/wc/index.js 42 kB
3 files skipped
1 deprecated class in use
lint: 1 error
retrying with --fix
build complete
Wrapped
PREVIEW
curl -s https://talos-ui.shelfwood.co/llms.txt | head -n 20
A long output line that wraps inside the transcript instead of scrolling it sideways.
---
import Terminal from "@j_shelfwood/talos-ui/astro/Terminal.astro";
---
<Terminal label="Build" cursor lines={[
{ type: "cmd", text: "bun run build" },
{ type: "out", text: "dist/wc/index.js 42 kB" },
{ type: "ok", text: "build complete" },
]} />
Props
| Prop | Type | Default | Meaning |
|---|---|---|---|
lines | TerminalLine[] | none | the transcript; without it the default slot renders |
wrap | boolean | false | wraps long lines instead of scrolling them sideways |
cursor | boolean | false | appends a prompt line with a blinking cursor |
label | string | "Terminal" | accessible name of the region |
class | string | none | extra classes on the <div> |
...rest | HTMLAttributes<"div"> | none | forwarded to the <div> |
TerminalLine is { type, text } with type one of "cmd", "out",
"ok", "warn", "err", "dim" or "hl"; each renders
.talos-terminal__line--<type>.