List
April 28, 2026 · View on GitHub
Scrollable selectable list of strings. Implements values.Setter[[]string] and Filterable, so it works with values.Update and Filter widgets.
Constructor: NewList(id, class string, items []string) *List
Methods
Items() []string— current itemsSet(value []string)— replace all items, reset selection to 0, redrawSelected() int— highlighted indexSelect(index int)— set highlighted indexMove(count int)— move highlight bycount(skips disabled items)First()— jump to first enabled itemLast()— jump to last enabled itemPageUp()/PageDown()— move by viewport heightFilter(filter string)— case-insensitive substring filter (empty string clears the filter)Suggest(query string) []string— items beginning withquery(used by Typeahead/Combo for ghost-text)Refresh()— queue a redraw
Events
| Event | Data | Description |
|---|---|---|
"select" | int | Highlighted item changed (arrow keys, click) |
"activate" | int | Item activated via Enter or double-click |
Notes
Flags: "focusable". Optional "search" flag enables incremental search-as-you-type.
Keyboard: ↑/↓ move; PgUp/PgDn page; Home/End jump to first/last; Enter activates the highlighted item.