Skip to content
ConsoleMonster
Class

TextInput

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

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

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.

Accepted by parameters 18

Constructors

public TextInput(string name, string? value = null) #

Creates a named, focusable single-line input using the shared line editor.

Parameters

name string required
The application-state key.
value string? = null optional
The initial text.

Properties

public string? Placeholder { get; set; } #

Muted text shown while the value is empty.

public string? Mask { get; set; } #

The mask character for secrets, or null to show the text. An empty string hides the text entirely.

public ThemeToken Token { get; set; } #

The theme token for entered text.

public string Value { get; set; } #

The text value; edits notify the application after the control lock is released.

public int MaxLength { get; set; } #

The maximum text length, in UTF-16 units.

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 required
The instance.
value bool = true optional
The value (default true).

Returns

TextInput The same instance.
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 required
The instance.
value string? required
The value.

Returns

TextInput The same instance.
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 required
The instance.
value string? required
The value.

Returns

TextInput The same instance.
public static TextInput WithMaxLength(TextInput textInput, int value) #

Sets TextInput.MaxLength: The maximum text length, in UTF-16 units.

Parameters

textInput ConsoleMonster.Interactive.TextInput required
The instance.
value int required
The value.

Returns

TextInput The same instance.
public static TextInput WithPlaceholder(TextInput textInput, string? value) #

Sets TextInput.Placeholder: Muted text shown while the value is empty.

Parameters

textInput ConsoleMonster.Interactive.TextInput required
The instance.
value string? required
The value.

Returns

TextInput The same instance.
public static TextInput WithTabIndex(TextInput textInput, int value) #

Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.

Parameters

textInput ConsoleMonster.Interactive.TextInput required
The instance.
value int required
The value.

Returns

TextInput The same instance.
public static TextInput WithToken(TextInput textInput, ThemeToken value) #

Sets TextInput.Token: The theme token for entered text.

Parameters

textInput ConsoleMonster.Interactive.TextInput required
The instance.
value ConsoleMonster.Styling.ThemeToken required
The value.

Returns

TextInput The same instance.
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 required
The instance.
value string? required
The value.

Returns

TextInput The same instance.
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 required
The instance.
value string required
The value.

Returns

TextInput The same instance.