Help us shape the future of Go! Take the 2026 Go Developer Survey

widgets

package
v0.0.0-...-88e3927 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseWidget

type BaseWidget struct {
	Cfg    config.Config
	Width  int
	Height int
	// contains filtered or unexported fields
}

BaseWidget provides common functionality

func (*BaseWidget) Error

func (b *BaseWidget) Error() error

func (*BaseWidget) SetSize

func (b *BaseWidget) SetSize(w, h int)

func (*BaseWidget) Value

func (b *BaseWidget) Value() string

type ChecklistWidget

type ChecklistWidget struct {
	BaseWidget
	Theme    theme.Theme
	Cursor   int
	Selected map[int]bool
	Viewport struct {
		Start int
		End   int
	}
}

func NewChecklist

func NewChecklist(cfg config.Config) *ChecklistWidget

func (*ChecklistWidget) Init

func (c *ChecklistWidget) Init() tea.Cmd

func (*ChecklistWidget) Update

func (c *ChecklistWidget) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ChecklistWidget) View

func (c *ChecklistWidget) View() string

type InputWidget

type InputWidget struct {
	BaseWidget
	Theme     theme.Theme
	InputText string
	Mask      bool
	Cursor    int
}

func NewInput

func NewInput(cfg config.Config, mask bool) *InputWidget

func (*InputWidget) Init

func (i *InputWidget) Init() tea.Cmd

func (*InputWidget) Update

func (i *InputWidget) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*InputWidget) View

func (i *InputWidget) View() string
type MenuWidget struct {
	BaseWidget
	Theme    theme.Theme
	Cursor   int
	Viewport struct {
		Start int
		End   int
	}
}

func NewMenu

func NewMenu(cfg config.Config) *MenuWidget
func (m *MenuWidget) Init() tea.Cmd
func (m *MenuWidget) Update(msg tea.Msg) (tea.Model, tea.Cmd)
func (m *MenuWidget) View() string

type MsgBoxWidget

type MsgBoxWidget struct {
	BaseWidget
	Theme theme.Theme
}

func NewMsgBox

func NewMsgBox(cfg config.Config) *MsgBoxWidget

func (*MsgBoxWidget) Init

func (m *MsgBoxWidget) Init() tea.Cmd

func (*MsgBoxWidget) Update

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

func (*MsgBoxWidget) View

func (m *MsgBoxWidget) View() string

type RadiolistWidget

type RadiolistWidget struct {
	BaseWidget
	Theme    theme.Theme
	Cursor   int
	Selected int // -1 if none
	Viewport struct {
		Start int
		End   int
	}
}

func NewRadiolist

func NewRadiolist(cfg config.Config) *RadiolistWidget

func (*RadiolistWidget) Init

func (r *RadiolistWidget) Init() tea.Cmd

func (*RadiolistWidget) Update

func (r *RadiolistWidget) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*RadiolistWidget) View

func (r *RadiolistWidget) View() string

type Widget

type Widget interface {
	tea.Model
	Value() string    // Returns selected value/output
	Error() error     // Returns cancellation or other errors
	SetSize(w, h int) // Handle terminal resize
}

Widget is the common interface for all dialogs

type YesNoWidget

type YesNoWidget struct {
	BaseWidget
	Theme   theme.Theme
	Focused int // 0 = Yes, 1 = No
}

func NewYesNo

func NewYesNo(cfg config.Config) *YesNoWidget

func (*YesNoWidget) Init

func (y *YesNoWidget) Init() tea.Cmd

func (*YesNoWidget) Update

func (y *YesNoWidget) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*YesNoWidget) View

func (y *YesNoWidget) View() string

Jump to

Keyboard shortcuts

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