Documentation
¶
Overview ¶
Package selectinput renders a bounded single-choice popover with an optional substring filter. The picker most agent UIs reach for when there are five to fifty options: a model selector, a workspace switcher, a destination chooser.
The package is named selectinput because select is a Go reserved word. The component owns a cursor and the optional filter; the parent observes SelectMsg on Enter (or Tab) and CancelMsg on Esc.
Index ¶
- type CancelMsg
- type Option
- type Select
- func (s Select) Cursor() int
- func (s Select) Init() tea.Cmd
- func (s Select) Selected() (Option, bool)
- func (s Select) Update(msg tea.Msg) (Select, tea.Cmd)
- func (s Select) View() string
- func (s Select) WithFilter(on bool) Select
- func (s Select) WithOptions(opts []Option) Select
- func (s Select) WithPlaceholder(p string) Select
- func (s Select) WithSelected(i int) Select
- func (s Select) WithSize(w, h int) Select
- func (s Select) WithTitle(title string) Select
- type SelectMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Select ¶
type Select struct {
// contains filtered or unexported fields
}
Select is a Bubble Tea model for a bounded single-choice picker.
func (Select) WithFilter ¶
WithFilter toggles the typeahead substring filter.
func (Select) WithOptions ¶
WithOptions replaces the option set and resets the cursor.
func (Select) WithPlaceholder ¶
WithPlaceholder sets the empty-filter placeholder. Filter-only.
func (Select) WithSelected ¶
WithSelected sets the initial cursor index, clamped.
