A reactive terminal UI framework for TypeScript and Bun.
bun add @rlabs-inc/tui
import { 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.
signal(0) creates a value that triggers updates when changedbox, text, input() => functions for dynamic values that update automaticallykeyboard.onKey('Enter', handler) for input handling