TextInput
ConsoleMonster.Interactive
Draws a LineEditor on one row: the text (or its mask), scrolled horizontally so the caret stays visible, a muted placeholder while empty, and the caret position reported to the CaretSlot when focused.
Inheritance
- InputControl
- TextInput
Usage
Explore 36 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 18
- Extension method TextInput.WithEnabled
- Extension method TextInput.WithLabel
- Extension method TextInput.WithMask
- Extension method TextInput.WithMaxLength
- Extension method TextInput.WithPlaceholder
- Extension method TextInput.WithTabIndex
- Extension method TextInput.WithToken
- Extension method TextInput.WithValidationMessage
- Extension method TextInput.WithValue
- Method TextInputFluent.WithEnabled
- Method TextInputFluent.WithLabel
- Method TextInputFluent.WithMask
- Method TextInputFluent.WithMaxLength
- Method TextInputFluent.WithPlaceholder
- Method TextInputFluent.WithTabIndex
- Method TextInputFluent.WithToken
- Method TextInputFluent.WithValidationMessage
- Method TextInputFluent.WithValue
Accepted by parameters 18
- Extension method TextInput.WithEnabled
- Extension method TextInput.WithLabel
- Extension method TextInput.WithMask
- Extension method TextInput.WithMaxLength
- Extension method TextInput.WithPlaceholder
- Extension method TextInput.WithTabIndex
- Extension method TextInput.WithToken
- Extension method TextInput.WithValidationMessage
- Extension method TextInput.WithValue
- Method TextInputFluent.WithEnabled
- Method TextInputFluent.WithLabel
- Method TextInputFluent.WithMask
- Method TextInputFluent.WithMaxLength
- Method TextInputFluent.WithPlaceholder
- Method TextInputFluent.WithTabIndex
- Method TextInputFluent.WithToken
- Method TextInputFluent.WithValidationMessage
- Method TextInputFluent.WithValue
Constructors
public TextInput(string name, string? value = null) #Creates a named, focusable single-line input using the shared line editor.
Parameters
- name string
- The application-state key.
- value string? = null
- The initial text.
Inherited Methods
public bool HandleInput(InputEvent input, RenderContext context) #Parameters
- input InputEvent
- context RenderContext
Returns
boolpublic Size Measure(Constraints constraints, RenderContext context) #Parameters
- constraints Constraints
- context RenderContext
Returns
Sizepublic void Render(Region region, RenderContext context) #Parameters
- region Region
- context RenderContext
Properties
Inherited Properties
Inherited Events
public event EventHandler<AppValueChangedEventArgs>? Changed #Extension Methods
public static TextInput WithEnabled(TextInput textInput, bool value = true) #Sets InputControl.Enabled: Whether the control accepts input and participates in focus traversal.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value bool = true
- The value (default true).
public static TextInput WithLabel(TextInput textInput, string? value) #Sets InputControl.Label: The visible label, or null to use the name.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value string?
- The value.
public static TextInput WithMask(TextInput textInput, string? value) #Sets TextInput.Mask: The mask character for secrets, or null to show the text. An empty string hides the text entirely.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value string?
- The value.
public static TextInput WithMaxLength(TextInput textInput, int value) #Sets TextInput.MaxLength: The maximum text length, in UTF-16 units.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value int
- The value.
public static TextInput WithPlaceholder(TextInput textInput, string? value) #Sets TextInput.Placeholder: Muted text shown while the value is empty.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value string?
- The value.
public static TextInput WithTabIndex(TextInput textInput, int value) #Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value int
- The value.
public static TextInput WithToken(TextInput textInput, ThemeToken value) #Sets TextInput.Token: The theme token for entered text.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value ConsoleMonster.Styling.ThemeToken
- The value.
public static TextInput WithValidationMessage(TextInput textInput, string? value) #Sets InputControl.ValidationMessage: The current validation message below the control, or null.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value string?
- The value.
public static TextInput WithValue(TextInput textInput, string value) #Sets TextInput.Value: The text value; edits notify the application after the control lock is released.
Parameters
- textInput ConsoleMonster.Interactive.TextInput
- The instance.
- value string
- The value.