A zero-external-dependency, micro-kernel Terminal User Interface framework for Node.js.
Find a file
2026-02-01 20:36:00 +02:00
.github update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
docs update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
examples add layout methods (width, height, flex) to breadcrumb and statusbar widgets, add border method to list widget, change plugin installation from start() time to construction time enabling immediate API availability, update file explorer to use new toast widget methods (success, error, info), update list widget API from selectedIndex to selectIndex and items to use id/label/value structure, update statusbar items from label to id/text structure, and update breadcrumb onSelect to onNavigate with type 2026-01-22 23:31:17 +02:00
src update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
tests update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
.codecov.yml update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
.editorconfig update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
.gitignore init 2026-01-20 02:21:06 +02:00
.nvmrc update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
.prettierignore update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
.prettierrc init 2026-01-20 02:21:06 +02:00
CHANGELOG.md update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
CONTRIBUTING.md update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
eslint.config.js init 2026-01-20 02:21:06 +02:00
LICENSE init 2026-01-20 02:21:06 +02:00
llms.txt init 2026-01-20 02:21:06 +02:00
package-lock.json add example runner scripts and tsx dev dependency 2026-01-20 03:21:55 +02:00
package.json update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
README.md update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
SECURITY.md update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
tsconfig.json init 2026-01-20 02:21:06 +02:00
tsup.config.ts update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00
vitest.config.ts update README with enhanced documentation including new tagline, additional badges (Node.js, coverage, downloads, stars, social), expanded features list highlighting 50+ widgets and 10+ themes with accessibility support, comprehensive widget categorization (layout, form, data display, feedback, advanced, content, visualization), complete plugin reference table, built-in theme list, improved quick start example with terminal output visualization, documentation links section, additional example files, condens 2026-02-01 20:36:00 +02:00

@oxog/tui

Build beautiful terminal interfaces with TypeScript - A zero-dependency, micro-kernel TUI framework for Node.js

npm version TypeScript License: MIT Node.js Coverage Downloads Stars

Stars Issues License Twitter

Features

  • 🚀 Zero External Dependencies - Only uses @oxog/* packages
  • 🔌 Micro-kernel Architecture - Modular plugin system for extensibility
  • 📦 TypeScript-First - Full type safety and excellent IntelliSense
  • Differential Rendering - Optimal performance with minimal redraws
  • 🎨 Flexbox-like Layout - Familiar layout system without external dependencies
  • 🧩 50+ Built-in Widgets - Everything you need to build terminal UIs
  • 🎭 10+ Built-in Themes - Beautiful themes including dark, light, and high contrast
  • ⌨️ Full Input Handling - Comprehensive keyboard and mouse support
  • 🔄 Animation Support - Tweening and frame-based animations
  • Accessible - High contrast theme and keyboard navigation support

Installation

npm install @oxog/tui

Quick Start

import { tui, box, text } from '@oxog/tui'
import { standardPlugins } from '@oxog/tui/plugins'

// Create the application
const app = tui({
  plugins: standardPlugins(),
  title: 'My TUI App'
})

// Build the UI
const root = box({ flexDirection: 'column' })
  .justify('center')
  .align('center')
  .add(text('Hello, World!').fg('#00ff00').bold(true))

// Handle keyboard input
app.on('key', (event) => {
  if (event.key === 'q') app.quit()
})

// Mount and start
app.mount(root)
app.start()

Terminal Output

┌─────────────────────────────────────────────────────────┐
│                                                         │
│                     Hello, World!                       │
│                                                         │
│                     Press q to quit                       │
│                                                         │
└─────────────────────────────────────────────────────────┘

Widgets

@oxog/tui includes 50+ built-in widgets:

Layout Containers

  • Box - Flexible container with padding, margin, border
  • Grid - CSS Grid-like 2D layout
  • SplitPane - Resizable split panels
  • Tabs - Tabbed navigation
  • Accordion - Collapsible panels

Form Widgets

  • Input - Text input field
  • Textarea - Multi-line text editor
  • Select - Dropdown selection list
  • Checkbox - Toggle checkbox
  • Slider - Range slider
  • Form - Form with validation

Data Display

  • Text - Styled text display
  • Table - Data table with sorting
  • Tree - Hierarchical tree view
  • List - Virtual scroll list
  • DataGrid - Advanced table with filtering

Feedback Widgets

  • Progress - Progress bar
  • Spinner - Loading animation
  • Toast - Notification messages
  • Modal - Dialog windows
  • Statusbar - Status information
  • Badge/Tag - Small status indicators
  • Tooltip - Hover tooltips

Advanced Widgets

  • Calendar - Date picker
  • ColorPicker - Color selection
  • CommandPalette - Quick command launcher
  • ContextMenu - Right-click menus
  • Menubar - Application menu bar
  • Breadcrumb - Navigation breadcrumb
  • Wizard - Multi-step wizard
  • Pagination - Data pagination
  • SearchInput - Search with suggestions

Content Widgets

  • CodeViewer - Syntax highlighted code
  • MarkdownViewer - Markdown rendering
  • LogViewer - Log file viewer
  • JsonViewer - JSON pretty printer
  • Image - ASCII art image display
  • Terminal - Embedded terminal
  • DiffViewer - Side-by-side diff

Visualization Widgets

  • BarChart - Bar chart
  • Sparkline - Mini chart
  • Gauge - Gauge/meter
  • Heatmap - Heat map visualization
  • Timeline - Timeline view
  • Kanban - Kanban board
  • Stopwatch - Timer/stopwatch

Plugins

Extend functionality with plugins:

import { standardPlugins } from '@oxog/tui/plugins'

const app = tui({
  plugins: [
    ...standardPlugins(), // Core plugins
    animationPlugin(),  // Animations
    mousePlugin(),      // Mouse support
    clipboardPlugin()   // Copy/paste
  ]
})

Available Plugins

Plugin Description
rendererPlugin Differential rendering to terminal
layoutPlugin Flexbox-like layout engine
stylePlugin Theme and style resolution
inputPlugin Keyboard input handling
mousePlugin Mouse event handling
focusPlugin Focus management
animationPlugin Animation and tweening
scrollPlugin Scrollable content
clipboardPlugin Copy/paste support
screenPlugin Screen management
statePlugin Redux-like state management
shortcutsPlugin Keyboard shortcuts
responsivePlugin Responsive layouts
routerPlugin URL-like routing

Theming

Built-in themes:

import {
  defaultTheme,
  lightTheme,
  draculaTheme,
  nordTheme,
  monokaiTheme,
  gruvboxTheme,
  solarizedDarkTheme,
  tokyoNightTheme,
  catppuccinMochaTheme,
  highContrastTheme
} from '@oxog/tui'

Create custom themes:

import { createTheme, defaultTheme } from '@oxog/tui'

const myTheme = createTheme('my', defaultTheme, {
  colors: {
    primary: '#ff0066',
    background: '#1a1a2e'
  }
})

Layout System

Flexbox-like layout:

box()
  .direction('row')           // Main axis
  .justify('center')         // Main alignment
  .align('stretch')          // Cross alignment
  .gap(1)                    // Spacing
  .padding(2)                // Padding
  .width(50)                 // Fixed width
  .height('50%')             // Percentage height
  .flex(1)                   // Grow factor

Documentation

Examples

See the examples directory for complete examples:

  • 01-hello-world.ts - Basic setup
  • 02-box-layout.ts - Flexbox layout
  • 03-form.ts - Form inputs
  • 04-progress-spinner.ts - Progress and spinner
  • 05-table.ts - Data table
  • 06-tree.ts - Tree view
  • 07-tabs.ts - Tabbed interface
  • 08-textarea.ts - Text editor
  • 09-theming.ts - Theme switching
  • comprehensive-dashboard.ts - Full-featured dashboard
  • app-system-monitor.ts - System monitor app
  • app-music-player.ts - Music player app
  • app-git-client.ts - Git client app
# Run examples
npm run example:hello
npm run example:dashboard

API Reference

Quick API

Export Description
tui(options) Create TUI application
box(props) Box container widget
text(content) Text display widget
input(props) Input field widget
select(props) Select dropdown widget
checkbox(props) Checkbox widget
progress(props) Progress bar widget
spinner(props) Loading spinner widget
textarea(props) Textarea widget
table(props) Data table widget
tree(props) Tree view widget
tabs(props) Tabs widget
modal(props) Modal dialog widget
toast Toast notifications
standardPlugins() Get standard plugins

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT © Ersin Koç


Made with ❤️ by Ersin Koç

WebsiteDocumentationGitHubnpm