v0.1.0 · MIT · zero runtime dependencies

High quality terminal UIfor TypeScript

btop-grade dashboards with a one-import API. Own the terminal directly, render only what changed, and make beautiful graphics a first-class primitive.

$bun add @profullstack/hqtui
hqtui-demo — dashboard
HQTUI dashboard: CPU, memory, network and processes

Captured from HQTUI's own renderer at 2x — the real frame, not a mockup.

0.29 ms
10% changed frame
0
runtime dependencies
30+
widgets
9
built-in themes

Ten lines to a real TUI

createApp() already gives you a dark theme, truecolor with automatic fallback, mouse tracking, the alternate screen, resize handling, adaptive frame pacing, and a terminal that is restored no matter how your process dies.

  • No configuration required to look good
  • 30 fps adaptive, 15 fps over SSH, 0 fps when idle
  • Degrades to 256/16 colours and ASCII automatically
hello.ts
import { createApp } from "@profullstack/hqtui";

const app = await createApp();

app.render(({ ui }) => {
  ui.panel({ title: "Hello" }, (panel) => {
    panel.text("Hello, terminal.");
  });
});

await app.start();
A hello world panel rendered by HQTUI

Everything a dashboard needs

The rendering pipeline is deliberately simple: application state, layout, widgets, framebuffer, diff, batched output. Nothing in between.

Differential rendering
Four typed arrays hold the screen. Each frame is diffed against the last and only changed runs are written, with a model of the terminal's pen so no escape sequence is repeated.
Zero dependencies
The library imports nothing. No ncurses, no native addon, no browser DOM, no React. It makes no network requests and spawns no subprocesses, ever.
Braille graphics
Every cell is a 2x4 pixel matrix, so a 40x10 panel plots at 80x40 resolution. Falls back to block elements, then ASCII, when the terminal cannot keep up.
Layout that solves itself
Rows, columns and grids with spans. Sizes are 12, "40%", "2fr", auto, or min/max. No manual coordinate arithmetic in application code.
Dark by default
Nine built-in themes and truecolor that quantizes automatically to 256 or 16 colours. NO_COLOR, monochrome and high-contrast modes are first class.
Real input handling
Normalized keys with modifiers, SGR mouse with drag and scroll, bracketed paste, focus events, and Tab traversal that works without wiring anything up.
Actually testable
A headless renderer returns text, ANSI, HTML or a cell grid. Assert on what the screen says without a TTY, a PTY, or a screenshot diff.
Restores your terminal
Ctrl+C, SIGTERM, an uncaught exception or a rejected promise: the alternate screen, cursor, raw mode and mouse tracking all go back the way they were.

Thirty widgets, one API

Panels, tables, trees, logs, meters, gauges, donuts, sparklines, graphs, tabs, modals, command palettes and every input control — all sized by the same layout engine, all themeable, all testable.

components
The HQTUI widget catalogue

Dark by default

Nine themes ship in the box, and every one of these previews is a live frame from the renderer. Vote for your favourite — the tally lives in SQLite.

theme: dark
HQTUI rendered with the dark theme

Fast by construction

The screen is one grid of cells in four typed arrays. Nothing allocates per cell in a hot path. Frames are diffed and only the changed runs are written, merged across short clean gaps because rewriting five cells is cheaper than an escape sequence.

Changing CPU 72% to CPU 73% writes a single character.

160x50 (8,000 cells) · bun 1.4 · linux x64 · reproduce with bun run bench

BenchmarkMeanOutput
Idle frame (0% changed)0.068 msno output written
1% of cells changed0.140 ms627 bytes/frame
10% of cells changed0.291 ms2,639 bytes/frame
50% of cells changed0.904 ms8,253 bytes/frame
Full 160x50 repaint0.393 ms8,000 cells
Six-panel dashboard build0.425 mslayout + widgets + diff

Run it on your machine

The reference dashboard reads real metrics on Linux, macOS and Windows with no native dependencies, or runs a deterministic simulation so screenshots and benchmarks are reproducible.

$bunx @profullstack/hqtui-demo
$bunx @profullstack/hqtui-demo --sim

Six screens: dashboard, components, graphics, themes, input visualizer, stress test.

HQTUI reference dashboard