buttons

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 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 AbortedMsg

type AbortedMsg struct{}

type KeyMap

type KeyMap struct {
	LeftButton  key.Binding
	RightButton key.Binding
	Accept      key.Binding
	Exit        key.Binding
}

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type Model

type Model struct {
	Question string
	Width    int
	// contains filtered or unexported fields
}

func NewModel

func NewModel(options ...ModelOption) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type ModelOption

type ModelOption func(*Model)

func WithActiveButton

func WithActiveButton(button string) ModelOption

func WithButtons

func WithButtons(buttons ...string) ModelOption

func WithQuestion

func WithQuestion(question string) ModelOption

func WithWidth

func WithWidth(width int) ModelOption

type SelectedMsg

type SelectedMsg struct {
	Index int
	Name  string
}

Jump to

Keyboard shortcuts

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