Terminal
A macOS-style terminal window that plays back a sequence of lines. input lines type out character by character; other types appear instantly. Great for install guides, CLI demos, and onboarding flows.
import { Terminal } from "@animui/ui"Basic
terminal
$█
Loop & custom title
Set loop to replay the sequence. Use title to change the title bar text.
~/project
$█
Props
| Prop | Type | Default | Description |
|---|---|---|---|
lines | TerminalLine[] | — | Sequence of lines to render. |
autoPlay | boolean | true | Start typing automatically on mount. |
speed | number | 50 | Milliseconds between each typed character for input lines. |
loop | boolean | false | Restart the sequence after the last line completes. |
title | string | "terminal" | Text shown in the macOS-style title bar. |
className | string | — | Additional classes for the terminal window. |
TerminalLine type
Each item in the lines array has the following shape:
type TerminalLine = {
text: string;
type?: "input" | "output" | "error" | "info";
delay?: number; // extra ms pause before this line
}| Prop | Type | Default | Description |
|---|---|---|---|
input | "input" | — | Types out character-by-character with a green prompt. |
output | "output" | — | Appears instantly in muted gray. |
error | "error" | — | Appears in red. |
info | "info" | — | Appears in blue. |