Documentation
¶
Index ¶
- func Showcase()
- type Item
- type Items
- type Model
- func (m *Model) Canceled() bool
- func (m *Model) Init() tea.Cmd
- func (m *Model) Quit() bool
- func (m *Model) SelectedItem() *Item
- func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- func (m *Model) WithCancel(cancelable bool) *Model
- func (m *Model) WithItems(items ...list.Item) *Model
- func (m *Model) WithQuit(quitable bool) *Model
- func (m *Model) WithSelectedIndex(i int) *Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents an item in the list.
func (*Item) Description ¶
Description returns the description of the list item.
func (*Item) FilterValue ¶
FilterValue returns the value used for filtering the list item.
type Model ¶
type Model struct {
List list.Model // List is the list model.
// contains filtered or unexported fields
}
Model represents the list model.
func (*Model) SelectedItem ¶
SelectedItem returns the selected item.
func (*Model) Update ¶
Update handles user input and updates the list state by processing key messages and updating the selected item accordingly.
func (Model) View ¶
View renders the list as a string, displaying the list items with their respective styles.
func (*Model) WithCancel ¶
WithCancel sets the cancelable flag and returns a new Model with the updated flag.
func (*Model) WithItems ¶
WithItems sets the list items and returns a new Model with the updated items.
func (*Model) WithQuit ¶
WithQuit sets the quitable flag and returns a new Model with the updated flag.
func (*Model) WithSelectedIndex ¶
WithSelectedIndex sets the index of the initially selected item and returns a new Model with the updated selected index.