A reactive terminal UI framework for TypeScript and Bun.
bun add @rlabs-inc/tuiimport { signal, box, text, mount, keyboard } from '@rlabs-inc/tui'
const count = signal(0)
const cleanup = await mount(() => {
box({
padding: 1,
children: () => {
text({ content: () => `Count: ${count.value}` })
text({ content: 'Press + to increment, q to quit' })
}
})
})
keyboard.onKey('+', () => { count.value++ })
keyboard.onKey('q', () => cleanup())Run with bun run your-file.ts.
- Signals - Reactive state:
signal(0)creates a value that triggers updates when changed - Primitives - UI building blocks:
box,text,input - Reactivity - Use
() =>functions for dynamic values that update automatically - Keyboard -
keyboard.onKey('Enter', handler)for input handling
- Quick Start Guide - Build your first app step by step