Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
Rows []Row
Cursor int
Values []int
Defaults []int
Locked []bool
IsReset []bool
Styles Styles
Hints []HelpHint
}
Model holds the state for an options picker overlay.
func New ¶
New creates a picker Model with the given rows and initial values. defaults, locked, and isReset slices must have the same length as rows.
func (*Model) Cycle ¶
func (m *Model) Cycle()
Cycle advances to the next choice, wrapping around to the first.
func (*Model) Left ¶
func (m *Model) Left()
Left selects the previous choice in the current row (clamped).
type Styles ¶
type Styles struct {
Box lg.Style // outer box style
Cursor string // prefix for the cursor row (e.g. "❯ ")
CursorLineBG string // raw ANSI background escape for cursor row (optional)
CursorPad string // prefix for non-cursor rows (e.g. " ")
Default lg.Style // default (but not selected) choice
HelpKey lg.Style // key hint style in footer
HelpText lg.Style // text hint style in footer
Inactive lg.Style // unselected choices
Label lg.Style // regular label style
LockedInactive lg.Style // unselected choices on locked rows
LockedLabel lg.Style // label style for locked rows
LockedSuffix string // text appended to locked rows (e.g. " (CLI)")
Selected lg.Style // currently selected choice
}
Styles controls the visual appearance of the picker overlay.
Click to show internal directories.
Click to hide internal directories.