Text.js

Text.js

React Apps in the Browser Console

Description

Want a small tool without writing an HTML page? Text.js is a React framework whose apps render in the browser console: build the UI from Box and Text, wire the up and down keys with useInput to change state, and drive it from DevTools.

Each frame is laid out with Yoga, run-length encoded into %c spans and written in one console.log; a frame with no changes logs nothing. Needs Bun 1.2+ or Node.js 22+ and a desktop Chrome, Edge, Firefox or Safari. MIT licensed.

Features



React for the UI: Components and hooks as usual, with layout from Box and Text.

Keyboard interaction: useInput receives keys and the screen redraws on state change.

Low output: Unchanged frames aren't sent, so the console doesn't flood.

One command to start: bunx create-text-app@latest, then bun dev and open localhost:3000.

Online playground: The website has a playground so you can try it without installing.