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 point | Why |
|---|---|---|
| Build a React TUI with components and hooks (Ink) | @visulima/tui | Full Ink-compatible component library with 50+ components |
| Build a React TUI with the native renderer | @visulima/tui/react | Native renderer with Rust-backed diff engine |
Paint terminal cells directly from a Uint32Array | @visulima/tui/core | Lowest-level runtime, direct control over render loop and buffer |
| Test TUI components in isolation | @visulima/tui/test | Framework-agnostic render + mock streams for testing |
@visulima/tui
The default entry point — full Ink-compatible React component library.
Primary exports:
render,renderToString- components:
Box,Text,Spinner,ProgressBar,SelectInput,MultiSelect,TextInput,ConfirmInput,Textarea,Slider,Alert,Badge,BigText,Code,DiffView,Dialog,FilePicker,Gradient,Help,Link,Markdown,Paginator,Stopwatch,Timer,Tab,Tabs,Table,TreeView,ScrollView,ScrollList, and more - hooks:
useInput,useApp,useFocus,useFocusManager,useAnimation,useTimer,useStopwatch,useKeyBindings,usePaste,useClipboard,useWindowSize,useBoxMetrics, and more
npm install @visulima/tui reactimport { render, Box, Text, Spinner, useInput, useTimer } from "@visulima/tui";@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:
RendererTerminalGuardterminalSizeCell,StyleMasksInputParserTuiAppcreateInlineLoop
npm install @visulima/tuiimport { 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 the main@visulima/tuientry point — the native renderer uses the same components.
npm install @visulima/tui reactimport { Box, Text } from "@visulima/tui";
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 withscreen,keys,waitFor,flushcleanup— unmount all test instances (use inafterEach)createScreen— standalone screen query helpers with ANSI strippingcreateKeySender— standalone keyboard input simulatorKEY— raw ANSI escape sequence constants for all common keyswaitFor— standalone async polling assertion
import { render, cleanup, KEY, createScreen, createKeySender, waitFor } from "@visulima/tui/test";