Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlinkMsg ¶
type BlinkMsg struct{}
BlinkMsg is sent when the cursor should alternate it's blinking state.
type ErrMsg ¶
type ErrMsg error
ErrMsg indicates there's been an error. We don't handle errors in the this package; we're expecting errors to be handle in the program that implements this text input.
type Model ¶
type Model struct { Err error Prompt string Cursor string BlinkSpeed time.Duration Placeholder string TextColor string BackgroundColor string PlaceholderColor string CursorColor string // CharLimit is the maximum amount of characters this input element will // accept. If 0 or less, there's no limit. CharLimit int // Width is the maximum number of characters that can be displayed at once. // It essentially treats the text field like a horizontally scrolling // viewport. If 0 or less this setting is ignored. Width int // contains filtered or unexported fields }
Model is the Tea model for this text input element.
func (*Model) CursorEnd ¶
func (m *Model) CursorEnd()
CursorEnd moves the cursor to the end of the field.
func (*Model) CursorStart ¶
func (m *Model) CursorStart()
CursorStart moves the cursor to the start of the field.
func (*Model) Reset ¶
func (m *Model) Reset()
Reset sets the input to its default state with no input.
func (*Model) SetCursor ¶
Cursor start moves the cursor to the given position. If the position is out of bounds the cursor will be moved to the start or end accordingly.
Click to show internal directories.
Click to hide internal directories.