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 EchoMode ¶ added in v0.7.1
type EchoMode int
EchoMode sets the input behavior of the text input field.
const ( // EchoNormal displays text as is. This is the default behavior. EchoNormal EchoMode = iota // EchoPassword displays the EchoCharacter mask instead of actual // characters. This is commonly used for password fields. EchoPassword // EchoNone displays nothing as characters are entered. This is commonly // seen for password fields on the command line. EchoNone )
type Model ¶
type Model struct { Err error Prompt string Placeholder string Cursor string BlinkSpeed time.Duration TextColor string BackgroundColor string PlaceholderColor string CursorColor string EchoMode EchoMode EchoCharacter rune // 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 Bubble 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) Paste ¶ added in v0.5.0
func (m *Model) Paste()
Paste pastes the contents of the clipboard into the text area (if supported).
func (*Model) Reset ¶
func (m *Model) Reset()
Reset sets the input to its default state with no input.
func (*Model) SetCursor ¶
SetCursor 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.