input

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 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 {
	PromptPrefix     string
	Prompt           string
	Placeholder      string
	CharLimit        int
	MaxWidth         int
	EchoMode         textinput.EchoMode
	Validate         ValidateFunc
	Styles           Styles
	Suggest          func(input string) []string
	SuggestionPrefix string
	// contains filtered or unexported fields
}

Model represents the bubble tea model for the input

func New

func New() Model

New creates a new model with default settings.

func (*Model) Init

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

func (*Model) SetValue

func (m *Model) SetValue(value string)

func (*Model) Update

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

func (*Model) Value

func (m *Model) Value() string

func (*Model) View

func (m *Model) View() string

type Styles

type Styles struct {
	PromptPrefix lipgloss.Style
	Prompt       lipgloss.Style
	ErrorPrefix  lipgloss.Style
	Text         lipgloss.Style
	Placeholder  lipgloss.Style
	Suggestions  lipgloss.Style
}

Styles holds relevant styles used for rendering For an introduction to styling with Lip Gloss see: https://github.com/charmbracelet/lipgloss

type ValidateFunc

type ValidateFunc validate.Func

ValidateFunc determines if the input string is valid, returning nil if valid or an error if invalid

Jump to

Keyboard shortcuts

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