input

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package input provides a themed text input component.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model wraps textinput.Model with themed defaults.

func New

func New(theme styles.Theme) *Model

New creates a new themed text input.

func (*Model) Blur

func (m *Model) Blur()

Blur removes focus from the input.

func (*Model) Focus

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

Focus focuses the input.

func (*Model) Focused

func (m *Model) Focused() bool

Focused returns whether the input is focused.

func (*Model) Init

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

Init implements tea.Model.

func (*Model) Reset

func (m *Model) Reset()

Reset clears the input value.

func (*Model) SetCharLimit

func (m *Model) SetCharLimit(limit int)

SetCharLimit sets the maximum character limit.

func (*Model) SetEchoCharacter

func (m *Model) SetEchoCharacter(char rune)

SetEchoCharacter sets the character used for password mode.

func (*Model) SetEchoMode

func (m *Model) SetEchoMode(mode textinput.EchoMode)

SetEchoMode sets the echo mode (normal, password, none).

func (*Model) SetPlaceholder

func (m *Model) SetPlaceholder(placeholder string)

SetPlaceholder sets the placeholder text.

func (*Model) SetValue

func (m *Model) SetValue(s string)

SetValue sets the input value.

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the input width.

func (*Model) ShortHelp

func (m *Model) ShortHelp() []key.Binding

ShortHelp returns the key bindings for the short help view. Text inputs don't expose editing keybindings in help; parent defines submit.

func (*Model) Update

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

Update implements tea.Model.

func (*Model) Value

func (m *Model) Value() string

Value returns the current input value.

func (*Model) View

func (m *Model) View() string

View renders the input with cursor marker.

Jump to

Keyboard shortcuts

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