ORIZEN/TUI
ComponentsCheckbox

Checkbox

stable

Arrow-key navigable list of toggleable boolean items.

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

checkbox.tsx
Select features:
[x]TypeScript
[x]ESLint
[ ]Prettier
[ ]Husky

Installation

npx orizen-tui@latest add checkbox

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

checkbox.imports.tsx
checkbox.example.tsx

Examples

Usage

checkbox.example1.tsx
Select features:
[x]TypeScript
[x]ESLint
[ ]Prettier
[ ]Husky

API Reference

Checkbox

items-
Array<{ label: string; value: string }>

List of toggleable items

value-
string[]

Selected values (controlled)

onChange-
(values: string[]) => void

Called when item is toggled (controlled)

defaultValue[]
string[]

Initial values (uncontrolled)

labelundefined
string

Heading above the list

focustrue
boolean

Whether list accepts keyboard events