Select list
A lightweight single-selection list. Navigate with ↑↓ or j/k; optionally wrap the cursor at the boundaries. Embed it in a parent model to build menus and pickers.
Install the package
Every component ships in the single dart_tui package.
$dart pub add dart_tui

SelectListModel(
items: ['Option A', 'Option B', 'Option C'],
title: 'Choose one',
wrap: true,
);
// The current choice:
final choice = list.items[list.cursor];SelectListModel
| Property | Type | Description |
|---|---|---|
| items | List<String> | Non-empty list of options. |
| cursor | int | Index of the highlighted item. |
| title | String | Optional heading above the list. |
| wrap | bool | Wrap the cursor past the first/last item. |
| styles | ListStyles | Styling for the cursor, selected and normal rows. |
Keybindings
↑ / kMove up
↓ / jMove down
enterSelect the highlighted item