Input
April 28, 2026 · View on GitHub
Single-line text input.
Constructor: NewInput(id, class string, params ...string) *Input
Params: [0] initial text, [1] placeholder, [2] mask character.
Methods
Get() string— current textSet(text string)— replace text (does not fireEvtChange)Insert(ch string)— insert text at cursorDelete()— backspace (delete before cursor)DeleteForward()— delete at cursorClear()— remove all textLeft() / Right()— move cursor by one runeStart() / End()— jump cursor to beginning/endSetMask(mask string)— set the mask character (used whenFlagMaskedis set)
Events
| Event | Data | Description |
|---|---|---|
"change" | string | Text was modified |
"enter" | string | Enter key pressed; data is the current value |
Notes
Flags: "focusable" (default), "masked" (display mask character instead of real characters; useful for passwords), "readonly" (disable editing without removing focusability).