React Terminal Console

A serial-console and log-viewer component in the style of a UART bring-up session: kernel-style timestamps, severity-colored lines (ok / warn / error / debug), a connection LED in the header, autoscroll, one-click copy, and an optional command prompt wired to your handler. The body is intentionally dark in both themes — consoles are dark; that is the convention engineers trust.

/dev/ttyUSB0 — 115200 8N1CONNECTED
axm330>

Try help, status, temp.

Installation

npx shadcn@latest add "http://localhost:3000/registry/terminal.json"

Usage

Loading...

Design notes

  • Whole-line severity color — like real consoles, the message line carries the color; timestamps stay dim so the eye can scan the log column.
  • Controlled log — lines is plain props data; stream, filter, or persist it however your app does. The demo replays a boot log and answers a few commands.
  • Autoscroll — the body follows the newest line; disable with autoScroll={false} for forensic reading.

Props

Terminal

PropTypeDefaultDescription
linesTerminalLine[]—Log lines, oldest first
titlestringconsoleHeader label, e.g. port and framing
promptstring—Renders an input row with this prompt when set
onCommand(cmd: string) => void—Called when Enter is pressed in the prompt
connectedbooleantrueDrives the header LED and label
heightnumber300Body height in pixels
autoScrollbooleantrueKeep the newest line in view

TerminalLine

PropTypeDefaultDescription
textstring—Line content
timestring—Timestamp shown in brackets
level'info' \'ok' \'warn' \

New components every week

Get the week's new Kelvin UI components and templates in one short email. No spam, unsubscribe anytime.