input

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package input implements generic UI input component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	textinput.Model

	FocusedPrompt string
	Tooltip       string
	Err           error
	// contains filtered or unexported fields
}

Input - input UI component.

func New

func New() *Input

New - component which consists from input and label.

func (*Input) Enabled

func (l *Input) Enabled() bool

Enabled returns component status - whether it can be changed or not.

func (*Input) Focus

func (l *Input) Focus() tea.Cmd

Focus the Input if it's not disabled.

func (*Input) Init

func (l *Input) Init() tea.Cmd

func (*Input) Label

func (l *Input) Label() string

Label returns the label value of the Input field.

func (*Input) SetDisplayTooltip

func (l *Input) SetDisplayTooltip(isDisplayed bool)

SetDisplayTooltip manages tooltip text which is displayed in the beginning of the input field.

Parameters: isDisplayed bool: a boolean value indicating whether the tooltip should be displayed.

func (*Input) SetEnabled

func (l *Input) SetEnabled(isEnabled bool)

SetEnabled controls whether the component can be focused and changed.

func (*Input) SetLabel

func (l *Input) SetLabel(label string)

SetLabel sets the label of the Input.

func (*Input) Update

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

func (*Input) View

func (l *Input) View() string

Jump to

Keyboard shortcuts

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