SYS:ONLINE● ACTIVE
THEME
GITHUBv0.1.0

TERMINAL

Scrollable log and output block. Supports five line types with distinct colors, optional timestamps, and a blinking cursor.

PREVIEW

MISSION LOG
00:00:01#SCIFICN OPERATING SYSTEM v4.1.0
00:00:02#Initializing subsystems...
00:00:04>connect --host 192.168.1.1 --port 8080
00:00:05 Establishing secure channel...
00:00:06 Connection established. Handshake OK.
00:00:10>scan --deep --target bridge
00:00:11Anomalous reading on deck 7. Possible interference.
00:00:14 Scan complete. 14 nodes found, 2 unresponsive.
00:00:15NODE-07 timeout. Retry limit exceeded.
00:00:20>status --all
>

INSTALLATION

BASH
npx shadcn@latest add @scificn/terminal

USAGE

TSX
import { Terminal, type TerminalLine } from '@/ui/terminal'

const [log, setLog] = React.useState<TerminalLine[]>([
  { type: 'system', text: 'System ready.' },
])

function sendCommand(cmd: string) {
  setLog(prev => [
    ...prev,
    { type: 'input',  text: cmd,               timestamp: now() },
    { type: 'output', text: 'Acknowledged.',    timestamp: now() },
  ])
}

<Terminal lines={log} title="COMMAND FEED" height="20rem" />

LINE TYPES

LINE TYPE REFERENCE
#System message — boot info, section headers.
>User input — commands typed at the prompt.
Standard output — normal response text.
Warning — degraded state, non-fatal.
Error — failure, timeout, or critical fault.

PROPS

PROPTYPEDEFAULTDESCRIPTION
linesTerminalLine[][]Array of log entries. Each has type, text, and optional timestamp.
titlestring"TERMINAL"Label shown in the title bar.
promptstring">"Prompt symbol shown beside the blinking cursor.
heightstring | number"16rem"Height of the scrollable output area.
blinkCursorbooleantrueShow the blinking block cursor at the end of the log.
classNamestringAdditional classes merged via cn().

TERMINALLINE FIELDS

PROPTYPEDEFAULTDESCRIPTION
textstringThe line content.
typeinput | output | warn | error | system"output"Controls prefix symbol and text color.
timestampstringundefinedOptional timestamp shown in muted color at the start.