components

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidInputErr = errors.New("Not a valid input.")

Functions

This section is empty.

Types

type Checkbox

type Checkbox struct {
	CheckedSymbol   string
	UncheckedSymbol string

	Cursor cursor.Model
	// contains filtered or unexported fields
}

func NewCheckBox

func NewCheckBox(checked bool) *Checkbox

func (*Checkbox) Blur

func (m *Checkbox) Blur()

func (*Checkbox) Focus

func (m *Checkbox) Focus() tea.Cmd

func (*Checkbox) Focused added in v1.1.0

func (m *Checkbox) Focused() bool

func (*Checkbox) HasReacted

func (m *Checkbox) HasReacted() bool

func (*Checkbox) Init

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

func (*Checkbox) ReactFlush

func (m *Checkbox) ReactFlush()

func (*Checkbox) Reset

func (m *Checkbox) Reset()

func (*Checkbox) SetChecked

func (m *Checkbox) SetChecked()

func (*Checkbox) SetUnchecked

func (m *Checkbox) SetUnchecked()

func (*Checkbox) SetValue

func (m *Checkbox) SetValue(checked InputValue) error

func (*Checkbox) Toggle

func (m *Checkbox) Toggle()

func (*Checkbox) Update

func (m *Checkbox) Update(msg tea.Msg) (Input, tea.Cmd)

func (*Checkbox) Value

func (m *Checkbox) Value() InputValue

Returns a wrapped bool

func (*Checkbox) View

func (m *Checkbox) View() string

type FilePicker

type FilePicker struct {
	SelectingFile bool

	Cursor cursor.Model
	// contains filtered or unexported fields
}

func NewFilePicker

func NewFilePicker(width int, allowedTypes ...string) *FilePicker

func (*FilePicker) Blur

func (m *FilePicker) Blur()

func (*FilePicker) Focus

func (m *FilePicker) Focus() tea.Cmd

func (*FilePicker) Focused added in v1.1.0

func (m *FilePicker) Focused() bool

func (*FilePicker) HasReacted

func (m *FilePicker) HasReacted() bool

func (*FilePicker) Init

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

func (*FilePicker) ReactFlush

func (m *FilePicker) ReactFlush()

func (*FilePicker) Reset

func (m *FilePicker) Reset()

func (*FilePicker) SetValue

func (m *FilePicker) SetValue(filePath InputValue) error

func (*FilePicker) TriggerSelection

func (m *FilePicker) TriggerSelection() tea.Cmd

func (*FilePicker) Update

func (m *FilePicker) Update(msg tea.Msg) (Input, tea.Cmd)

func (*FilePicker) Value

func (m *FilePicker) Value() InputValue

Returns a wrapped string

func (*FilePicker) View

func (m *FilePicker) View() string

type Input

type Input interface {
	Update(tea.Msg) (Input, tea.Cmd)
	View() string
	Init() tea.Cmd

	Focus() tea.Cmd
	Blur()

	Value() InputValue
	SetValue(InputValue) error
	Reset()
}

type InputValue

type InputValue any

type Number

type Number struct {
	Default float64

	DecrementSymbol rune
	IncrementSymbol rune

	Cursor cursor.Model
	// contains filtered or unexported fields
}

func NewNumber

func NewNumber(minValue float64, maxValue float64) *Number

func (*Number) Blur

func (m *Number) Blur()

func (*Number) ClampValue

func (m *Number) ClampValue()

func (*Number) Decrement

func (m *Number) Decrement()

func (*Number) Focus

func (m *Number) Focus() tea.Cmd

func (*Number) Focused added in v1.1.0

func (m *Number) Focused() bool

func (*Number) HasReacted

func (m *Number) HasReacted() bool

func (*Number) Increment

func (m *Number) Increment()

func (*Number) Init

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

func (*Number) ReactFlush

func (m *Number) ReactFlush()

func (*Number) Reset

func (m *Number) Reset()

func (*Number) SetDelta

func (m *Number) SetDelta(delta float64)

func (*Number) SetValue

func (m *Number) SetValue(value InputValue) error

func (*Number) Update

func (m *Number) Update(msg tea.Msg) (Input, tea.Cmd)

func (Number) Value

func (m Number) Value() InputValue

Returns a wrapped float64

func (Number) View

func (m Number) View() string

type Reactor

type Reactor interface {
	HasReacted() bool
	ReactFlush()
}

type TextInput

type TextInput struct {
	Input            textinput.Model
	InvalidHighlight string
	// contains filtered or unexported fields
}

func (*TextInput) Blur

func (m *TextInput) Blur()

func (*TextInput) Focus

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

func (*TextInput) Focused added in v1.1.0

func (m *TextInput) Focused() bool

func (*TextInput) HasReacted

func (m *TextInput) HasReacted() bool

func (*TextInput) Init

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

func (*TextInput) ReactFlush

func (m *TextInput) ReactFlush()

func (*TextInput) Reset

func (m *TextInput) Reset()

func (*TextInput) SetValue

func (m *TextInput) SetValue(str InputValue) error

func (*TextInput) Update

func (m *TextInput) Update(msg tea.Msg) (Input, tea.Cmd)

func (*TextInput) Value

func (m *TextInput) Value() InputValue

Returns a wrapped string

func (*TextInput) View

func (m *TextInput) View() string

Jump to

Keyboard shortcuts

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