ORIZEN/TUI

Table

stable

Navigable data table with column alignment and scroll.

Browser preview is a simulation. The copied component runs in actual terminal apps.

table.tsx
RankCityCountryPopulation
------------------------------------------------------------
6Mexico Ci…Mexico22,085,140
7CairoEgypt21,750,020
8BeijingChina21,333,332
9MumbaiIndia20,961,472
10OsakaJapan19,059,856
11ChongqingChina16,874,740
12KarachiPakistan16,839,950

Installation

npx orizen-tui@latest add table

if dependency install fails, run: npm install ink@^5.0.1 react@^18.3.1 @types/react@^18.3.18 orizen-tui-core@latest

Usage

table.imports.tsx
table.example.tsx

Examples

Usage

table.example1.tsx
RankCityCountryPopulation
------------------------------------------------------------
6Mexico Ci…Mexico22,085,140
7CairoEgypt21,750,020
8BeijingChina21,333,332
9MumbaiIndia20,961,472
10OsakaJapan19,059,856
11ChongqingChina16,874,740
12KarachiPakistan16,839,950

API Reference

Table

columns
TableColumn[]

Column definitions (key, label, width, align)

data
Record<string, string>[]

Row data array

height10
number

Number of visible data rows

focustrue
boolean

Whether to accept keyboard navigation