Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Windows

  • Safari
  • WindowFrame
  • Chrome
  • Terminal

Devices

  • iPhone
  • Android
  • Tablet
  • Watch

Terminal

terminal

Displays terminal commands and output in a styled window shell.

Usage

Basic usage

lines is rendered line by line, and when mounted, it fades in the order of lineDelay.

bash
$pnpm add @hulianui/ui
✓ Installation completed
tsx
<Terminal
  lines={[
    { prompt: "$", text: "pnpm add @hulianui/ui", tone: "command" },
    { text: "✓ Installation completed", tone: "success" },
  ]}
/>

Customize title and reveal cadence

title changes the window title bar text, lineDelay adjusts the display interval of adjacent rows.

zsh
$pnpm dev
▲ Next.js ready on http://localhost:5512
tsx
<Terminal
  title="zsh"
  lineDelay={0.6}
  lines={[
    { prompt: "$", text: "pnpm dev", tone: "command" },
    { text: "▲ Next.js ready on http://localhost:5512", tone: "muted" },
  ]}
/>

Turn off syntax coloring

highlight={false} does not split the word coloring, and the whole line is tone color.

bash
$echo hello world
hello world
tsx
<Terminal
  highlight={false}
  lines={[
    { prompt: "$", text: "echo hello world", tone: "command" },
    { text: "hello world", tone: "muted" },
  ]}
/>

When to Use

Display terminal fragments such as installation commands, CLI output, build logs, etc., and reveal step-by-step animations and color them by tone (command/output/success). They are often used in the "Quick Start" and "Installation" sections of landing pages. This is a read-only visual demonstration box, not an interactive terminal (if you want real terminal capabilities, look for an xterm solution); to include web page screenshots, use Safari/Chrome.

Import

ts
import { Terminal } from "@hulianui/ui"

Props

NameTypeDefaultDescription
lines*TerminalLine[]-Array of rows to be revealed row by row (see table below).
lineDelaynumber0.4Delay between adjacent lines in seconds
titlestring"bash"Title-bar text
highlightbooleantrueApply syntax colors to commands, flags, URLs, numbers, and quoted strings. This affects string-valued command and muted lines; ReactNode and success lines keep a single tone color.
classNamestring-Additional class name for the root container

TerminalLine:

FieldTypeDescription
text*ReactNodeLine of text.
promptstringStart of line prompt (such as "$", ">"), none by default.
tone"command" | "muted" | "success"The tone of this line: command (foreground) / muted (secondary output) / success.

Usage Guidelines

  • Syntax coloring only splits words for lines where text is a string and tone is command/muted; the entire line where ReactNode or success is passed is colored with tone, and no secondary coloring is performed.
  • The staggered reveal is a client-side animation. Terminal already declares its own "use client" boundary.

Related

Safari · Chrome · iPhone · Android · Tablet · Watch

PreviousChromeDevice MockupsNextiPhone

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Usage Guidelines
    • Related