New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dino-dna/react-tui

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dino-dna/react-tui

React in your terminal emulator

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
2
Weekly downloads
 
Created
Source

@dino-dna/react-tui

React in your terminal emulator.

react-tui-demo

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

Install

npm install --prod @dino-dna/react-tui neo-blessed react
# or,
yarn add @dino-dna/react-tui neo-blessed react

Usage

Manual & API

Click here to visit the manual.

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
import React from "react";
import blessed from "neo-blessed";
import { createBlessedRenderer } from "@dino-dna/react-tui";
// setup a blessed screen & container
const screen = blessed.screen({
  /* ... */
});
screen.key(["q", "C-c"], () => process.exit(0));
const render = createBlessedRenderer(blessed, screen);
const container = blessed.box();
screen.append(container);
// initialize react
const DemoApp: React.FC = () => <>Greetings from react-tui</>;
render(<DemoApp />, container);
// ^look familiar? same API as ReactDOM.render(el, container)

Demo

We host a variety of runnable demos. To run the the demo app:

  • clone, git clone https://github.com/dino-dna/react-tui react-tui
  • cd react-tui
  • install dependencies, npm ci
  • compile, npx tsc (or npx tsc -w for watch mode)
  • run the demo, npm run demo

Keywords

FAQs

Package last updated on 07 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc