GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - reachjalil/prettui: Composable TypeScript terminal UI packages for exact-frame TUIs.

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.github
.github
 
 
docs
docs
 
 
packages
packages
 
 
scripts
scripts
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
RELEASE-CHECKLIST.md
RELEASE-CHECKLIST.md
 
 
SECURITY.md
SECURITY.md
 
 
biome.json
biome.json
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
tsconfig.base.json
tsconfig.base.json
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

prettui

CI npm @prettui/kit Security License

prettui is a TypeScript library for rendering composable terminal UI frames: ANSI helpers, layout primitives, charts, panels, dashboard layouts, and a kitchen-sink demo that shows advanced TUI patterns. It also includes an opinionated framework layer for dynamic TUI apps with typed routes, expandable navigation, focus zones, menus, transitions, and exact-frame shell rendering.

npx @prettui/cli demo
npx @prettui/cli demo --choice kitchen-sink
npx @prettui/cli demo --snapshot --cols 178 --rows 48 --no-color

Install

npm install @prettui/kit

For the modular packages, install only what you use:

npm install @prettui/core @prettui/components @prettui/dashboard
npm install @prettui/kit

Usage

import { renderTuiDashboard } from "@prettui/kit";

const frame = renderTuiDashboard({
  width: 120,
  height: 36,
  color: true,
  brand: {
    title: "prettui",
    subtitle: "Terminal operations dashboard",
  },
  metrics: [],
  navigation: { items: [] },
  events: [],
  inspector: { title: "INSPECTOR", id: "evt_1", value: {} },
  files: [],
  footer: { status: [], controls: ["[q] Quit"] },
});

process.stdout.write(frame);

Subpath exports are available for focused imports:

import { fitAnsi, visibleLength } from "@prettui/core/ansi";
import { bars, segmentedDonut } from "@prettui/core/charts";
import { renderPanel } from "@prettui/components";
import { renderTuiDemo } from "@prettui/demo";
import { createTuiAppState, reduceTuiAppEvent, renderTuiApp } from "@prettui/framework";

Packages

Package Use
@prettui/core ANSI helpers, chart primitives, and exact-frame layout utilities.
@prettui/components Reusable panels, cards, tables, footers, and data widgets.
@prettui/dashboard Opinionated event/dashboard frame renderer.
@prettui/framework Typed routes, navigation, focus, menus, transitions, and shell rendering.
@prettui/layouts Higher-order analytics, stream, event, and workflow layouts.
@prettui/demo Demo renderers and kitchen-sink fixtures.
@prettui/cli prettui demo executable.
@prettui/kit Convenience package that re-exports the public toolkit.

Opinionated Framework

Use @prettui/framework when you want prettui to own the standard TUI app patterns: navigation layout, route history, focus movement, menu-driven route changes, transitions, responsive shell composition, and dynamic render context.

import { createTuiAppState, renderTuiApp, type TuiAppDefinition } from "@prettui/framework";
import { renderPanel } from "@prettui/components";

const app: TuiAppDefinition<{ queueDepth: number }> = {
  title: "prettui",
  subtitle: "Operations console",
  initialRouteId: "overview",
  context: { queueDepth: 12 },
  navigation: [
    { id: "primary", label: "Primary", items: [{ id: "overview", label: "Overview", routeId: "overview" }] },
  ],
  routes: [
    {
      id: "overview",
      title: "Overview",
      render: ({ width, height, context }) =>
        renderPanel({ title: "Queue", children: [`Depth: ${context.queueDepth}`], width, height, color: false }),
    },
  ],
};

const state = createTuiAppState(app);
process.stdout.write(renderTuiApp(app, state, { width: 120, height: 36, color: false }));

See docs/FRAMEWORK.md for routing, composition, and interaction patterns.

What It Includes

  • ANSI color, width, truncation, padding, and selection helpers.
  • Layout primitives for boxes, horizontal stacks, tables, ratios, and exact frame normalization.
  • Terminal chart primitives: bars, low bars, sparklines, dash states, and segmented donuts.
  • Reusable panels for brand headers, navigation, events, JSON inspectors, file activity, tables, footers, analytics widgets, timelines, logs, heatmaps, and key/value groups.
  • Higher-level dashboard layouts and a kitchen sink that documents layout patterns and TUI implementation practices.
  • An optional framework layer for route-driven TUI apps with typed state, expandable navigation, focus zones, menus, and transitions.

Boundaries

prettui renders strings. The low-level primitives do not own application state. The optional framework reducer can own common TUI state such as routes, focus, menus, and transitions, while host apps still control terminal input, process lifecycle, persistence, telemetry, and network behavior.

Development

pnpm install
pnpm run quality

See CONTRIBUTING.md, docs/DEVELOPMENT.md, and docs/PUBLISHING.md.

About

Composable TypeScript terminal UI packages for exact-frame TUIs.

github.com/reachjalil/prettui

Topics

ansiterminaltuitypescript

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.