Package Map

Choose the right @visulima/tui sub-package for your use case

Package Map

@visulima/tui is a single package with multiple entry points.

Use this page to decide which entry to import and where each API lives.

Quick Choice

If you want to…Use entry pointWhy
Get render and lower-level primitives@visulima/tuiBare entry — render, layout/measurement, mouse, terminal palette
Use any hook (useInput, useFocus, …)@visulima/tui/hooks/<kebab-name>Each hook is published at its own subpath
Build a React TUI with the native renderer@visulima/tui/reactNative renderer with Rust-backed diff engine
Paint terminal cells directly from a Uint32Array@visulima/tui/coreLowest-level runtime, direct control over render loop and buffer
Use any component (Box, Text, Spinner, …)@visulima/tui/components/<kebab-name>Each component is published at its own subpath
Render ASCII-art headlines (cfonts)@visulima/tui/components/big-textHeavy cfonts dep is loaded only when imported
Render syntax-highlighted code (shiki)@visulima/tui/components/codeHeavy shiki deps are loaded only when imported
Render diffs (diff + shiki)@visulima/tui/components/diff-viewHeavy diff + shiki deps are loaded only when imported
Render Markdown (marked + shiki)@visulima/tui/components/markdownHeavy marked + shiki deps are loaded only when imported
Render data tables (@visulima/tabular)@visulima/tui/components/tableHeavy @visulima/tabular dep is loaded only when imported
Test TUI components in isolation@visulima/tui/testFramework-agnostic render + mock streams for testing

@visulima/tui

The bare entry point — render, layout/measurement helpers, and other lower-level primitives. Components and hooks live on per-symbol subpaths (see @visulima/tui/components/<name> and @visulima/tui/hooks/<name> below).

Primary exports:

  • render, renderToString
  • primitives: MouseProvider, parseSgrMouse, processLayout, measureElement, applySelectionToStyledLine, clearOsc52, writeOsc52, …
npm install @visulima/tui react
import { render } from "@visulima/tui";

@visulima/tui/hooks/<name>

Every hook lives at its own subpath under @visulima/tui/hooks/<kebab-name>. This keeps the import graph small and makes it explicit which hook you depend on.

import { useAnimation } from "@visulima/tui/hooks/use-animation";
import { useFocus } from "@visulima/tui/hooks/use-focus";
import { useInput } from "@visulima/tui/hooks/use-input";
import { useTimer } from "@visulima/tui/hooks/use-timer";

Each subpath exports the hook as both a named export and a default export, plus its option/result types. Hook names map directly to their kebab-case subpath (useAnimationuse-animation, useFocusManageruse-focus-manager). The createLinkedScrollGroup factory lives at use-linked-scroll.

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

@visulima/tui/components/<name>

Every component lives at its own subpath under @visulima/tui/components/<kebab-name>. This keeps the import graph small — you only pull in what you use, and heavy peer dependencies are loaded only when their component is imported.

import { Box } from "@visulima/tui/components/box";
import { Text } from "@visulima/tui/components/text";
import { Spinner } from "@visulima/tui/components/spinner";
import { TextInput } from "@visulima/tui/components/text-input";
import { ProgressBar } from "@visulima/tui/components/progress-bar";

Each subpath exports the component as both a named export and a default export, plus its *Props type. PascalCase component names map to kebab-case subpaths (BigTextbig-text, SelectInputselect-input, TreeViewtree-view).

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.

Heavy component subpaths

A few components have large optional peer dependencies. Importing them via their subpath keeps your bundle small and makes the peer requirements explicit per component.

SubpathComponentRequired peer dependencies
@visulima/tui/components/big-textBigTextcfonts
@visulima/tui/components/codeCodeshiki, @shikijs/langs, @shikijs/themes
@visulima/tui/components/diff-viewDiffViewdiff, shiki, @shikijs/langs, @shikijs/themes
@visulima/tui/components/markdownMarkdownmarked, shiki, @shikijs/langs, @shikijs/themes
@visulima/tui/components/tableTable@visulima/tabular

Install only what you need:

# BigText
npm install @visulima/tui react cfonts

# Code (and DiffView with syntax highlighting)
npm install @visulima/tui react shiki @shikijs/langs @shikijs/themes

# DiffView (without syntax highlighting)
npm install @visulima/tui react diff

# Markdown (with code block highlighting)
npm install @visulima/tui react marked shiki @shikijs/langs @shikijs/themes

# Table
npm install @visulima/tui react @visulima/tabular

Importing a heavy subpath without its peer dependencies installed will throw a module-not-found error at runtime.

React DevTools

Mounting the React DevTools overlay is opt-in and gated by the DEV=true environment variable. To enable it, install the optional peers:

npm install --save-dev react-devtools-core ws
DEV=true node ./my-app.js

When DEV is unset, neither react-devtools-core nor ws is loaded.

@visulima/tui/core

Framework-agnostic runtime backed by the Rust diff engine.

Primary APIs are exposed to TypeScript/JavaScript while rendering is handled by a native Rust diff engine.

Primary exports:

  • Renderer
  • TerminalGuard
  • terminalSize
  • Cell, StyleMasks
  • InputParser
  • TuiApp
  • createInlineLoop
npm install @visulima/tui
import { Renderer, TerminalGuard, terminalSize } from "@visulima/tui/core";

@visulima/tui/react

Native React renderer — uses a Rust-backed diff engine for high-performance rendering.

Depends on @visulima/tui/core for terminal output and native diffing.

Primary exports:

  • render, renderInline, renderToString
  • components: Static, DevTools
  • hooks: useInput, useApp, useFocus, useFocusManager, useMouse, useScrollable, useTextInput, useWindowSize, and more

Components (Box, Text, Spinner, etc.) are imported from their dedicated subpaths under @visulima/tui/components/<name> — the native renderer uses the same components.

npm install @visulima/tui react
import { Box } from "@visulima/tui/components/box";
import { Text } from "@visulima/tui/components/text";
import { render, useInput } from "@visulima/tui/react";

@visulima/tui/test

Framework-agnostic testing utilities for TUI components. Inspired by ink-testing-library and ink-testing.

Primary exports:

  • render — render a component with mock streams, returns test instance with screen, keys, waitFor, flush
  • cleanup — unmount all test instances (use in afterEach)
  • createScreen — standalone screen query helpers with ANSI stripping
  • createKeySender — standalone keyboard input simulator
  • KEY — raw ANSI escape sequence constants for all common keys
  • waitFor — standalone async polling assertion
import { render, cleanup, KEY, createScreen, createKeySender, waitFor } from "@visulima/tui/test";

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