Xzero UI
Pro library

Typewriter terminalPro

A terminal that types a scripted CLI session with a seeded human cadence, colors the shell syntax, and streams output lines, progress bars and spinners, with a scrubber, play/pause and replay controls.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/typewriter-terminal
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/typewriter-terminal

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { TypewriterTerminal } from "@/components/xzero/typewriter-terminal/typewriter-terminal";

export function InstallHero() {
  return (
    <TypewriterTerminal
      title="Install"
      steps={[
        {
          command: "npm install @acme/sdk",
          output: [
            { kind: "progress", label: "Fetching packages", duration: 1.2 },
            { text: "Added 12 packages in 1.8s", tone: "success" },
          ],
        },
        {
          command: "npx acme login",
          output: [
            { kind: "task", label: "Opening the browser", done: "0.3s" },
            "Signed in as dana@acme.dev",
          ],
        },
      ]}
      rows={8}
    />
  );
}

API reference

TypewriterTerminal

A terminal window that types a scripted CLI session with a human cadence. Each command is colored as shell syntax while it is typed: the program, flags, strings, paths and packages, operators, and env assignments. Output streams in underneath as plain lines, progress bars that fill with a realistic stall, and spinners that resolve to a tick with a timing. The screen follows the newest line on a spring, and a scrubber under the window rewinds and replays the whole session, so the text untypes and retypes under your finger.

PropTypeDefaultDescription
steps{ command: string; output?: TypewriterTerminalOutput[]; cwd?: string; pause?: number }[]A create-next-app, shadcn add, and npm run dev sessionThe session in order. cwd changes the working directory shown in this prompt and every later one. pause is the rest in seconds after the output.
TypewriterTerminalOutputstring | { text, tone?, delay? } | { kind: "progress", label, duration? } | { kind: "task", label, done?, duration? }–A string prints a plain line and an empty string a blank line. tone is default, muted, success, warning, danger, or accent; success, warning, and danger add a matching icon. URLs in text are shown as links. A progress line fills a bar with a percentage. A task shows a spinner, then a tick and its done text, such as 0.4s.
titlestring"zsh"Window title in the title bar.
cwdstring"~"Working directory shown in the prompt until a step sets its own.
symbolstring"$"Prompt symbol after the working directory.
speednumber1Multiplies the playback pace. At 1 the default session takes about sixteen seconds. The cadence itself is seeded from the commands, so it is identical in every replay and on the server.
pausedbooleanfalseHolds playback where it is, easing to rest instead of stopping in one frame.
loopbooleantrueAfter a short rest the screen clears upward and the session plays again while the scrubber glides back to the start. When false, playback stops on the final prompt and the play button replays.
rowsnumber11Visible rows. The window keeps this height and older lines scroll up as the session grows.
copyablebooleantrueShows a copy button in the title bar that copies every command, one per line.
accentstring–Color of the caret, progress fills, spinners, links, and the scrubber. Defaults to the accent token.
labelstring"Terminal session"Accessible name of the figure.
captionReactNode–Optional visible caption under the terminal, rendered as a figcaption.
classNamestring–Extra class on the root figure.
styleCSSProperties–Inline styles on the root figure.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in type

Guidance for AI tools

Typewriter terminal: A terminal that types a scripted CLI session with a seeded human cadence, colors the shell syntax, and streams output lines, progress bars and spinners, with a scrubber, play/pause and replay controls. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components