ORIZEN/TUI

Select

stable

Arrow-key navigable single-choice list with full keyboard support.

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

select.tsx
Pick a framework:
React
Vue
Svelte
Solid

Installation

npx orizen-tui@latest add select

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

select.imports.tsx
select.example.tsx

Examples

Usage

select.example1.tsx
Pick a framework:
React
Vue
Svelte
Solid

API Reference

Select

items-
ReadonlyArray<{ label: string; value: T }>

List items

value-
T

Selected value (controlled)

onSelect-
(item) => void

Called when item is selected (optional)

initialIndex0
number

Initially highlighted item (uncontrolled)

labelundefined
string

Heading above the list

focustrue
boolean

Whether list accepts keyboard events