Introduction

Overview

What is Terminosaurus?

Terminosaurus is an open-source terminal GUI library that allows you to create terminal applications with ease. It doesn't depend on any specific framework, but provides a powerful React renderer that you can use to create complex terminal applications.

Quick example

Here's a simple example of a Terminosaurus application:

import {StyleValues, TermText, length, run} from 'terminosaurus';

run(screen => {
    const text = new TermText();
    text.setText('Hello, world!');
    text.appendTo(screen.rootNode);

    text.style.reset({
        border: StyleValues.Border.Modern,
        padding: [length(0), length(1)],
        fontWeight: StyleValues.FontWeight.Bold,
    });
});

And here's the exact same application, but using JSX:

import {render} from 'terminosaurus/react';

render(
    <term:div border={`modern`} padding={[0, 1]} fontWeight={`bold`}>
        Hello, world!
    </term:div>
);

Comparison table

FeatureTerminosaurusInkBlessed
Framework-agnostic API
React renderer⚠️ ¹
Flexbox layout
Relative / absolute positioning
Focus management
Scrolling
Text alignment
Text wrapping
CSS properties✅ ²

¹ Blessed kinda supports React 17 thanks to react-blessed, but it's unmaintained.

² Ink also supports some CSS properties, but not as much as Terminosaurus.