#979·tview

Feature request: generalize list items

Author: voodookiidooCreated Apr 30, 2024Updated Aug 6, 2026
Labelswill consider

Currently, tview.List is based around text and secondary text. But if you need to store a list of items and keep their representation valid - you have to keep a list of some items somewhere else, and keep track of their order. What about adding a CustomList (call it how you want), where instead of using plain text for items, use an interface like

type interface ListItem {
GetText() string
GetSecondaryText() string
GetRune() rune
GetSelectionFunction() func()
}

That would make maintaining both data and it's view much easier! (I implemented it in my fork of your lib, can show you if you'd like to)