input

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 7 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 {
	BlurPrompt   string                 // BlurPrompt controls the prompt to display in blur mode.
	FocusPrompt  string                 // FocusPrompt controls the prompt to display in focus mode.
	Validate     func(str string) error // Validate validsts the value to display input with style.
	TextStyle    lipgloss.Style         // TextSyle applies in blur mode.
	ValidStyle   lipgloss.Style         // ValidStyle applies when the input is valid in focus mode.
	InvalidStyle lipgloss.Style         //InvalidStyle applies when the input in invalid in focus mode.
	// contains filtered or unexported fields
}

Model displays the content with terminal style.

func New added in v0.0.3

func New(opts ...func(Model) Model) Model

New creates a new input model.

func (*Model) Blur

func (m *Model) Blur() tea.Cmd

func (*Model) EnableSuggestion added in v0.0.3

func (m *Model) EnableSuggestion(value bool)

func (*Model) Focus

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

func (Model) Focused

func (m Model) Focused() bool

func (Model) Height

func (m Model) Height() int

func (Model) ID

func (m Model) ID() uuid.UUID

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) KeyBindings added in v0.0.3

func (m Model) KeyBindings() (bindings []key.Binding)

func (*Model) SetSuggestions added in v0.0.3

func (m *Model) SetSuggestions(suggestions []string)

func (*Model) SetValue

func (m *Model) SetValue(str string) bool

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

func (Model) Update

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

func (Model) Value

func (m Model) Value() string

func (Model) View

func (m Model) View() string

func (Model) Width

func (m Model) Width() int

Jump to

Keyboard shortcuts

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