React in your terminal emulator.
react-tui is both:
- a component library, and
- a react reconciler for rendering
blessed-style widgets into react
This project was originally a fork of react-blessed to add Typescript, but soon became a moderate rewrite of the reconciler with a component library and a growing visual test suite.
Table Of Contents
npm install --prod @dino-dna/react-tui neo-blessed react# or,yarn add @dino-dna/react-tui neo-blessed react
Manual & API
If you are a web developer or a react-native developer, developing with react-tui will be challenging at first. Your terminal does not have an excellent box model like we are used to in those environments, and available API implementations in this space are both more limited and subjectively less robust. We strongly recommend reading the manual before trying to write a nice terminal app.
Rendering a basic application
// get-started.tsx;;;// setup a blessed screen & container;screen.key,process.exit0;;;screen.appendcontainer;// initialize react;render, container;// ^look familiar? same API as ReactDOM.render(el, container)
We host a variety of runnable demos. To run the the demo app:
git clone https://github.com/dino-dna/react-tui react-tui
- install dependencies,
npx tsc -wfor watch mode)
- run the demo,
npm run demo