Terminal
Animated terminal window that types a scripted shell session.
Import
import { Terminal } from "@cooud-ui/ui";
npx cooud-ui add terminal
Examples
API Reference
Generated from the component's exported types.
TerminalProps
Extends Omit<HTMLAttributes<HTMLDivElement>, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
lines* | TerminalLine[] | — | The scripted session, played from first to last. |
title | string | — | Title shown centered in the chrome bar (e.g. `"zsh"` or a file path). |
chrome | boolean | true | Render the macOS-style chrome bar (three dots + title). Defaults to `true`. |
prompt | string | "$" | Prompt glyph rendered before each input line. Defaults to `"$"`. |
typingSpeed | number | DEFAULT_TYPING_SPEED | Milliseconds per typed character. Defaults to `30`. |
loop | boolean | false | Restart the script from the top after it finishes. Defaults to `false`. |
loopDelay | number | DEFAULT_LOOP_DELAY | Milliseconds the finished transcript rests before a loop restarts. Defaults to `2000`. |
copyButton | boolean | true | Show a copy button that copies the joined `input` commands (one per line, without the prompt) — the exact text a reader wants to paste into their own shell. Defaults to `true`; hidden automatically when the script has no input lines. |
motionPreference | TerminalMotionPreference | "respect" | Whether the typing animation plays vs. honours `prefers-reduced-motion`: `"respect"` (default), `"always"` (force motion), or `"never"` (always static). |