Terminal Window
newTerminal chrome with prompt-led commands, coloured output and an optional typing animation.
~/acme — zsh
npx shadcn@latest add @blank/terminal-window
Installation
npx shadcn@latest add @blank/terminal-windowUsage
import {
TerminalWindow,
TerminalWindowHeader,
TerminalWindowBody,
TerminalLine,
TerminalTyping,
} from "@/components/ui/terminal-window"<TerminalWindow>
<TerminalWindowHeader>~/acme — zsh</TerminalWindowHeader>
<TerminalWindowBody>
<TerminalLine>
<TerminalTyping>npx shadcn@latest add @blank/button</TerminalTyping>
</TerminalLine>
<TerminalLine variant="success">✔ Done.</TerminalLine>
</TerminalWindowBody>
</TerminalWindow>TerminalTyping starts when it scrolls into view and calls onComplete when
the last character lands, which is the hook for revealing the output that
follows. The full command is laid out invisibly beneath the typed text, so the
line never reflows, and screen readers get the whole command at once. With
reduced motion it renders complete and calls onComplete straight away.
Examples
Output
variant colours a line and drops the prompt: output, success, warning
and error. prompt replaces the $ on command lines.
blank — pnpm test
pnpm test --run
RUN v3.2.4 ~/blank
✓ button.test.tsx (12 tests) 41ms
✓ card.test.tsx (6 tests) 18ms
⚠ tabs.test.tsx (1 skipped)
✗ chart.test.tsx › renders a legend
Tests 1 failed | 1 skipped | 18 passed (20)