Multi-select
NewA scrollable checkbox list supporting multiple concurrent selections. Navigate with ↑↓/jk, toggle with Space/x, select all/none with a, and confirm with Enter.
Install the package
Every component ships in the single dart_tui package.
$dart pub add dart_tui

final multi = MultiSelectModel(
title: 'Pick your languages',
items: const [
MultiSelectItem(label: 'Dart', value: 'dart'),
MultiSelectItem(label: 'Go', value: 'go'),
MultiSelectItem(label: 'Rust', value: 'rust'),
],
height: 10,
showStatusBar: true, // shows "N/Total selected"
wrap: true,
);
// After the user presses Enter, read the checked items:
final chosen = multi.items
.where((item) => item.selected)
.map((item) => item.value)
.toList();MultiSelectModel
| Property | Type | Description |
|---|---|---|
| items | List<MultiSelectItem> | Options; each has a label, value and selected flag. |
| title | String | Heading above the list. |
| height | int | Visible rows before scrolling. Defaults to 10. |
| showStatusBar | bool | Show the 'N/Total selected' status bar. |
| wrap | bool | Wrap the cursor at list boundaries. |
Keybindings
↑ / k, ↓ / jMove cursor
space / xToggle item
aSelect all / none
enterConfirm selection