selector

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Styles Styles
	// contains filtered or unexported fields
}

func New

func New(prompt string, choices []string, height int, width int) Model

func (*Model) GetChoices

func (m *Model) GetChoices() []string

func (Model) GetSelected

func (m Model) GetSelected() string

func (*Model) Height

func (m *Model) Height() int

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) Reset

func (m *Model) Reset()

func (*Model) SetChoices

func (m *Model) SetChoices(choices []string)

func (*Model) SetHeight

func (m *Model) SetHeight(height int)

func (*Model) SetIsActive

func (m *Model) SetIsActive(active bool)

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

func (*Model) Width

func (m *Model) Width() int

type Styles

type Styles struct {
	CheckmarkStyle      lipgloss.Style
	CheckedChoiceStyle  lipgloss.Style
	SelectedChoiceStyle lipgloss.Style

	PromptStyle   lipgloss.Style
	ActiveStyle   lipgloss.Style
	InactiveStyle lipgloss.Style
	// contains filtered or unexported fields
}

func DefaultStyles

func DefaultStyles() (s Styles)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL