Ballmac UI home

Terminal

A terminal window with command, output, success, error and comment lines, optional per-command copy buttons and a sequenced typing animation that respects reduced motion.

~/my-app
pnpm dlx shadcn@latest add @ballmac/button
✔ Checking registry.
✔ Installing dependencies.
Success: Created 1 file: components/ballmac/button.tsx
# Import it from @/components/ballmac/button

Installation

$ pnpm dlx shadcn@latest add @ballmac/terminal

Usage

import { Terminal, TerminalLine, TerminalAnimated } from "@/components/ballmac/terminal"

The full example is in the Code tab above.

Examples

Typing animation

API reference

<Terminal>

PropTypeDefault
title

Text in the title bar, e.g. "zsh" or "~/my-app".

string—
theme

"dark" scopes the theme's dark tokens to the window in light mode too; "inherit" follows the page.

"dark" | "inherit""dark"
bodyClassName

Classes for the scrolling body.

string—

<TerminalAnimated>

PropTypeDefault
speed

Typing speed for command lines, in characters per second.

number36
lineDelay

Pause before each non-command line appears, in milliseconds.

number140
startDelay

Wait before the first line starts, in milliseconds.

number300
startOnView

Start only once the terminal scrolls into view.

booleantrue
onComplete

Called when every line has been revealed.

() => void—

<TerminalLine>

PropTypeDefault
prompt

Prompt shown before command lines.

string"$"
copyable

Show a copy button for command lines (copies the text without the prompt).

booleanfalse
typing

Type the command out character by character (string children only). Implied inside TerminalAnimated.

boolean—
speed

Characters per second when typing outside TerminalAnimated.

number—
variant"command" | "output" | "success" | "error" | "comment""output"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabFocuses the copy button on command lines (hidden until hover on mouse devices, visible on focus)
—The prompt symbol is hidden from screen readers; success and error lines carry a text prefix, not just color; aria-busy is set while animating

Use with AI

Show CLI sessions: <Terminal title> with <TerminalLine variant='command' copyable> and output lines. Wrap lines in <TerminalAnimated> to type commands out and reveal output in order when scrolled into view. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Terminal (@ballmac/terminal) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Install and setup steps on landing pages and docs
  • Showing what a CLI prints, including success and error lines
  • An animated hero that types a command and its result

Not for

  • Copyable install commands for several package managers (use install-tabs)
  • Source code files (use code-block)
  • A real interactive shell (this renders static or scripted lines only)

Registry JSON: https://ui.ballmac.com/r/terminal.json

Credits

Free to use in personal and commercial projects.