Documentation ¶
Index ¶
- Constants
- type TextInputModel
- func (m *TextInputModel) Blur()
- func (m *TextInputModel) Delete() tea.Cmd
- func (m *TextInputModel) Focus(maxChars int)
- func (m TextInputModel) Focused() bool
- func (m TextInputModel) Init() tea.Cmd
- func (m *TextInputModel) Insert(runes []rune) tea.Cmd
- func (m *TextInputModel) MoveLeft()
- func (m *TextInputModel) MoveRight()
- func (m *TextInputModel) Resize(width int)
- func (m *TextInputModel) SetPrompt(prompt string)
- func (m *TextInputModel) SetText(text string)
- func (m TextInputModel) Text() string
- func (m TextInputModel) Update(msg tea.Msg) (TextInputModel, tea.Cmd)
- func (m TextInputModel) View() string
Constants ¶
const Padding = 1 // how much left and right padding to add
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextInputModel ¶
type TextInputModel struct {
// contains filtered or unexported fields
}
TextInputModel is the TextInputModel for a textinput. The textinput allows users to enter and modify text.
func InitialModel ¶
func InitialModel(name string, prompt string) TextInputModel
InitialModel builds the model.
func (*TextInputModel) Blur ¶
func (m *TextInputModel) Blur()
Blur blurs the input. Once it is no longer focused it will no longer accept input.
func (*TextInputModel) Delete ¶
func (m *TextInputModel) Delete() tea.Cmd
Delete deletes the rune in front of the cursor.
func (*TextInputModel) Focus ¶
func (m *TextInputModel) Focus(maxChars int)
Focus focuses the input. If it is focused it will be accepting input.
func (TextInputModel) Focused ¶
func (m TextInputModel) Focused() bool
Focus returns true if this input is focused.
func (*TextInputModel) Insert ¶
func (m *TextInputModel) Insert(runes []rune) tea.Cmd
Insert inserts runes in front of the cursor.
func (*TextInputModel) MoveLeft ¶
func (m *TextInputModel) MoveLeft()
MoveLeft moves the cursor the left once space.
func (*TextInputModel) MoveRight ¶
func (m *TextInputModel) MoveRight()
MoveRight moves the cursor to right once space.
func (*TextInputModel) Resize ¶
func (m *TextInputModel) Resize(width int)
Resize changes the size of the input.
func (*TextInputModel) SetPrompt ¶
func (m *TextInputModel) SetPrompt(prompt string)
SetPrompt sets the prompt for the input.
func (*TextInputModel) SetText ¶
func (m *TextInputModel) SetText(text string)
SetText sets the text inside the input.
func (TextInputModel) Text ¶
func (m TextInputModel) Text() string
Text returns the current text in the input.
func (TextInputModel) Update ¶
func (m TextInputModel) Update(msg tea.Msg) (TextInputModel, tea.Cmd)
Update handles a message.