Documentation
¶
Overview ¶
Package textinput renders a multi-line text input with a 2D cursor, placeholder, focus, word-jumps on Alt+Left/Right, and Ctrl-U to kill the current line up to the cursor. It is a thin Bubble Tea model — the consumer owns the code and is expected to extend it (history, paste handlers, line wrapping, syntax styling) by editing the file directly.
Index ¶
- type CancelMsg
- type Input
- func (i Input) Blur() Input
- func (i Input) Cursor() (int, int)
- func (i Input) Focus() Input
- func (i Input) Focused() bool
- func (i Input) Init() tea.Cmd
- func (i Input) Reset() Input
- func (i Input) Update(msg tea.Msg) (Input, tea.Cmd)
- func (i Input) Value() string
- func (i Input) View() string
- func (i Input) WithHeight(h int) Input
- func (i Input) WithPlaceholder(s string) Input
- func (i Input) WithValue(s string) Input
- func (i Input) WithWidth(w int) Input
- type SubmitMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is a Bubble Tea model for a multi-line text input.
func New ¶
New constructs an Input using the given theme. Focused by default, with a single empty line, width 60 cells, and four visible rows.
func (Input) WithHeight ¶
WithHeight sets the number of visible rows. Clamped to >= 1.
func (Input) WithPlaceholder ¶
WithPlaceholder sets the placeholder shown when the value is empty.
