components

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckboxItem

type CheckboxItem struct {
	Label       string
	Description string
	Value       any
	Checked     bool
	Enabled     bool // If false, item is shown but not selectable
}

CheckboxItem represents a single checkbox option

type CheckboxList

type CheckboxList struct {
	// contains filtered or unexported fields
}

CheckboxList manages a list of checkboxes with multi-selection

func NewCheckboxList

func NewCheckboxList(items []CheckboxItem) *CheckboxList

NewCheckboxList creates a new checkbox list. Creates a copy of the items slice to avoid modifying the caller's data. Callers must explicitly set Enabled for each item.

func (*CheckboxList) Blur

func (c *CheckboxList) Blur()

Blur removes focus

func (*CheckboxList) CheckedItems

func (c *CheckboxList) CheckedItems() []CheckboxItem

CheckedItems returns only the checked items

func (*CheckboxList) CheckedValues

func (c *CheckboxList) CheckedValues() []any

CheckedValues returns the values of checked AND enabled items Disabled items are excluded even if checked (they represent pre-existing state)

func (*CheckboxList) Focus

func (c *CheckboxList) Focus()

Focus sets the focus state

func (*CheckboxList) IsFocused

func (c *CheckboxList) IsFocused() bool

IsFocused returns true if the checkbox list is focused

func (*CheckboxList) Items

func (c *CheckboxList) Items() []CheckboxItem

Items returns all items

func (*CheckboxList) SelectAll

func (c *CheckboxList) SelectAll()

SelectAll checks all enabled items

func (*CheckboxList) SelectNone

func (c *CheckboxList) SelectNone()

SelectNone unchecks all items

func (*CheckboxList) SetChecked

func (c *CheckboxList) SetChecked(index int, checked bool)

SetChecked sets the checked state by index

func (*CheckboxList) Toggle

func (c *CheckboxList) Toggle()

Toggle toggles the current item

func (*CheckboxList) Update

func (c *CheckboxList) Update(msg tea.Msg) tea.Cmd

Update handles keyboard input

func (*CheckboxList) View

func (c *CheckboxList) View() string

View renders the checkbox list

func (*CheckboxList) ViewHelp

func (c *CheckboxList) ViewHelp() string

ViewHelp renders help text for the checkbox list

type Progress

type Progress struct {
	// contains filtered or unexported fields
}

Progress displays step progress

func NewProgress

func NewProgress(steps []string) *Progress

NewProgress creates a new progress indicator

func (*Progress) CurrentStep

func (p *Progress) CurrentStep() int

CurrentStep returns the current step index

func (*Progress) CurrentStepName

func (p *Progress) CurrentStepName() string

CurrentStepName returns the name of the current step

func (*Progress) SetStep

func (p *Progress) SetStep(step int)

SetStep sets the current step index

func (*Progress) TotalSteps

func (p *Progress) TotalSteps() int

TotalSteps returns the total number of steps

func (*Progress) View

func (p *Progress) View() string

View renders the progress indicator

func (*Progress) ViewCompact

func (p *Progress) ViewCompact() string

ViewCompact renders a compact progress indicator (single line)

type RadioGroup

type RadioGroup struct {
	// contains filtered or unexported fields
}

RadioGroup manages a group of radio buttons with single selection

func NewRadioGroup

func NewRadioGroup(options []RadioOption) *RadioGroup

NewRadioGroup creates a new radio group with the given options

func NewRadioGroupSimple

func NewRadioGroupSimple(labels []string) *RadioGroup

NewRadioGroupSimple creates a radio group from simple string labels

func (*RadioGroup) Blur

func (r *RadioGroup) Blur()

Blur removes focus

func (*RadioGroup) Focus

func (r *RadioGroup) Focus()

Focus sets the focus state

func (*RadioGroup) IsFocused

func (r *RadioGroup) IsFocused() bool

IsFocused returns true if the radio group is focused

func (*RadioGroup) Selected

func (r *RadioGroup) Selected() int

Selected returns the index of the selected option

func (*RadioGroup) SelectedOption

func (r *RadioGroup) SelectedOption() RadioOption

SelectedOption returns the selected option

func (*RadioGroup) SetSelected

func (r *RadioGroup) SetSelected(index int)

SetSelected sets the selected option by index

func (*RadioGroup) Update

func (r *RadioGroup) Update(msg tea.Msg) tea.Cmd

Update handles keyboard input

func (*RadioGroup) View

func (r *RadioGroup) View() string

View renders the radio group

type RadioOption

type RadioOption struct {
	Label       string
	Description string
}

RadioOption represents a single radio button option

type TextInput

type TextInput struct {
	// contains filtered or unexported fields
}

TextInput wraps bubbletea's textinput with additional features

func NewTextInput

func NewTextInput(label string) *TextInput

NewTextInput creates a new text input with a label

func (*TextInput) Blur

func (t *TextInput) Blur()

Blur removes focus

func (*TextInput) Focus

func (t *TextInput) Focus() tea.Cmd

Focus sets the focus state

func (*TextInput) IsFocused

func (t *TextInput) IsFocused() bool

IsFocused returns true if the input is focused

func (*TextInput) SetValue

func (t *TextInput) SetValue(value string)

SetValue sets the input value

func (*TextInput) Update

func (t *TextInput) Update(msg tea.Msg) tea.Cmd

Update handles keyboard input

func (*TextInput) Value

func (t *TextInput) Value() string

Value returns the current input value

func (*TextInput) View

func (t *TextInput) View() string

View renders the text input with its label

func (*TextInput) ViewInline

func (t *TextInput) ViewInline() string

ViewInline renders the text input with label on the same line

func (*TextInput) WithMasked

func (t *TextInput) WithMasked() *TextInput

WithMasked enables password masking

func (*TextInput) WithPlaceholder

func (t *TextInput) WithPlaceholder(placeholder string) *TextInput

WithPlaceholder sets the placeholder text

func (*TextInput) WithWidth

func (t *TextInput) WithWidth(width int) *TextInput

WithWidth sets the input width

Jump to

Keyboard shortcuts

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