Skip to content

Modern Tui TuiTextInput

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Input Widgets › TuiTextInput

TuiTextInput

Draws a one-line text box with a cursor, selection and optional password masking.

Syntax

type TuiTextInput extends TuiWidget
    as TuiTextInputState ptr state
    as ustring placeholder
    as TuiStyle normal, focused_, placeholderStyle, selectionStyle
    as boolean password
end type

Description

A one-line editor: cursor, selection, word movement, password masking. Editing keys are left/right, Ctrl+left/right by word, home/end, backspace, delete, and shift+arrows to select. MAKE normal AND focused_ DIFFERENT, or focus is invisible and the application looks broken.

Example

#import "std/tui"
using tui

dim as TuiTextInputState st
TuiTextInputStateInit( st )
st.text = "quinn"

dim as TuiTheme th = TuiThemeDefault( )
dim as TuiTextInput box
box.state = @st
box.placeholder = "your name"
box.normal = th.normal
box.focused_ = th.selected        '' visibly different

'' Inside an app's View( byref f as TuiFrame ) it is drawn with
'' box.Render( f, area )

print st.text                     '' quinn -- read the value straight out

See also

TuiTextInputState TuiTextInput.SelectionEnd TuiTextArea TuiCheckbox
TuiTextInputStateInit TuiTextInput.DeleteSelection TuiTextAreaState TuiRadioGroup
TuiTextInput.SelectionStart TuiTextInput.Insert TuiTextAreaStateInit TuiSelect

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Input Widgets
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally