ORIZEN/TUI

List

stable

Filterable, paginated scrollable list with an integrated loading spinner.

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

list.tsx
Groceries72 items
Pocky
Ginger
Plantains
Honey Dew
Pineapple
(1–5 of8)

Installation

npx orizen-tui@latest add list

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

list.imports.tsx
list.example.tsx

Examples

Usage

list.example1.tsx
Groceries72 items
Pocky
Ginger
Plantains
Honey Dew
Pineapple
(1–5 of8)

API Reference

List

items
ListItem[]

Items to display

height8
number

Number of visible items

widthundefined
number

Width of the list in columns

filter""
string

Case-insensitive filter string

onSelectundefined
(item: ListItem) => void

Called when Enter is pressed on an item

isLoadingfalse
boolean

Show loading spinner instead of items

focustrue
boolean

Whether to accept keyboard input

colorundefined
string

Text color