Documentation
¶
Overview ¶
Package picker provides a filterable single-select list overlay for the tui/app shell — a type-to-filter input over a windowed list, rendered as a centered modal.
The overlay closes itself and emits a ResultMsg; the hosting Content matches on Key to tell pickers apart:
case picker.ResultMsg:
if field, ok := msg.Key.(configField); ok { ... }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// Label is the row text; Detail is dimmed, right-aligned extra text.
// Both are matched by the filter.
Label string
Detail string
// Value is returned in ResultMsg.
Value string
}
Item is one selectable row.
type Options ¶
type Options struct {
// Key is echoed in ResultMsg so apps with several pickers can tell
// results apart.
Key any
Title string
// Help is dimmed explanatory text under the title.
Help string
Items []Item
// InitialIndex preselects an item.
InitialIndex int
// Placeholder for the filter input (default "Type to filter").
Placeholder string
// Header is an optional column-header line rendered above the rows.
Header string
// MaxWidth bounds the modal (default 70).
MaxWidth int
}
Options configure New.
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay is a centered filterable list modal.
Click to show internal directories.
Click to hide internal directories.