Documentation
¶
Index ¶
- Constants
- Variables
- func NewSpinner(color bool) spinner.Model
- type SelectModel
- func (m SelectModel) Done() bool
- func (m SelectModel) Init() tea.Cmd
- func (m SelectModel) Selected() int
- func (m SelectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m SelectModel) View() tea.View
- func (m SelectModel) WithCursor(i int) SelectModel
- func (m SelectModel) WithHint(hint string) SelectModel
- type TokenModel
Constants ¶
View Source
const ( KeyCtrlC = "ctrl+c" KeyEnter = "enter" KeyEsc = "esc" KeyBackspace = "backspace" KeyHome = "home" KeyEnd = "end" KeySlash = "/" // Letter keys. The value is the literal bubbletea reports; uppercase // variants are the shifted key (e.g. "N" for shift+n). KeyQ = "q" KeyN = "n" KeyShiftN = "N" KeyG = "g" KeyShiftG = "G" )
Key constants map bubbletea key-press string representations to named values.
Variables ¶
Functions ¶
func NewSpinner ¶
Types ¶
type SelectModel ¶
type SelectModel struct {
// contains filtered or unexported fields
}
SelectModel is a single-choice picker rendered as a vertical list with a cursor (›) marking the focused option. ↑/↓ or k/j move; Enter confirms; Esc/Ctrl+C cancels.
func NewSelectModel ¶
func NewSelectModel(prompt string, options []string) SelectModel
func (SelectModel) Done ¶
func (m SelectModel) Done() bool
Done reports whether the user has confirmed a selection.
func (SelectModel) Init ¶
func (m SelectModel) Init() tea.Cmd
func (SelectModel) Selected ¶
func (m SelectModel) Selected() int
Selected returns the index chosen by the user. Only valid when Done().
func (SelectModel) View ¶
func (m SelectModel) View() tea.View
func (SelectModel) WithCursor ¶
func (m SelectModel) WithCursor(i int) SelectModel
WithCursor returns a copy of the model with the initial cursor positioned at index i, clamped to the available options. Use this to pre-select a default choice.
func (SelectModel) WithHint ¶
func (m SelectModel) WithHint(hint string) SelectModel
WithHint returns a copy of the model with a custom footer hint line.
type TokenModel ¶
type TokenModel struct {
// contains filtered or unexported fields
}
func NewTokenModel ¶
func NewTokenModel() TokenModel
func (TokenModel) Init ¶
func (m TokenModel) Init() tea.Cmd
func (TokenModel) Token ¶
func (m TokenModel) Token() string
func (TokenModel) View ¶
func (m TokenModel) View() tea.View
Click to show internal directories.
Click to hide internal directories.