Getting Started

Install @visulima/tui and choose the right rendering mode for your project

Getting Started

@visulima/tui supports three runtime modes.

ModePrimary APIImport pathBest for
React moderender(<App />)@visulima/tui/reactComponent-driven TUIs with hooks and Yoga layout
Raw-buffer modeRenderer + renderer.render@visulima/tui/coreDirect per-cell rendering and custom loops
Inline moderenderInline / createInlineLoop@visulima/tui/react / @visulima/tui/coreFixed-height UI below the cursor
Testingrender / cleanup / screen / keys / waitFor / flush@visulima/tui/testTest components with mock streams, no real terminal

Install

React apps (most users)

npm install @visulima/tui react react-reconciler

Raw-buffer / non-React apps

npm install @visulima/tui

@visulima/tui/core is a TypeScript-facing runtime with a native Rust diff/render engine. React is an optional peer dependency.

Component imports

Every component is published at its own subpath under @visulima/tui/components/<kebab-name>. Hooks, render, and primitives stay on the bare @visulima/tui entry.

import { Box } from "@visulima/tui/components/box";
import { Text } from "@visulima/tui/components/text";
import { Spinner } from "@visulima/tui/components/spinner";
import { useApp } from "@visulima/tui/hooks/use-app";
import { useInput } from "@visulima/tui/hooks/use-input";
import { render } from "@visulima/tui";

This means you only pull in the components you actually use, and heavy peer dependencies stay tree-shakeable.

Breaking from earlier alphas. Components are no longer re-exported from the bare @visulima/tui entry — you must import each one from its own subpath.

Optional peer dependencies

A few components have heavy peer dependencies. Install only the peers for the components you actually use:

ComponentSubpathRequired peers
BigText@visulima/tui/components/big-textcfonts
Code@visulima/tui/components/codeshiki, @shikijs/langs, @shikijs/themes
DiffView@visulima/tui/components/diff-viewdiff (+ shiki, @shikijs/langs, @shikijs/themes for syntax highlighting)
Markdown@visulima/tui/components/markdownmarked (+ shiki, @shikijs/langs, @shikijs/themes for code blocks; @visulima/tabular for tables)
Table@visulima/tui/components/table@visulima/tabular

To enable the React DevTools overlay (DEV=true), install the optional peers react-devtools-core and ws.

See Package Map › Heavy component subpaths for full installation snippets.

Requirements

  • Node.js: 20.19 or higher

Run examples in this repository

# React mode
node --import @oxc-node/core/register examples/kitchen-sink.tsx
node --import @oxc-node/core/register examples/counter.tsx

# Raw-buffer mode
node --import @oxc-node/core/register examples-raw/matrix.ts
node --import @oxc-node/core/register examples-raw/conway.ts

# Inline mode (React)
node --import @oxc-node/core/register examples/inline-minimal.tsx

See Examples for the full list.

Ink migration (typical)

- import { render, Box, Text } from 'ink'
+ import { render } from '@visulima/tui'
+ import { Box } from '@visulima/tui/components/box'
+ import { Text } from '@visulima/tui/components/text'

Most app-level API usage maps directly. See Ink Compatibility for caveats and stubs.

Next Steps

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues