TextInput
ClassFor examples and usage details, see the component documentation.
View TextInput ComponentNamespace:
RazorConsole.ComponentsAssembly:
RazorConsole.CoreDefinition
public class TextInput : ComponentBase, IComponent, IHandleEvent, IHandleAfterRenderConstructors
1| Name | Type | Description |
|---|---|---|
TextInput() | Constructor | — |
Properties
25| Name | Type | Description |
|---|---|---|
Behavior | ||
Disabled | Boolean | Whether the input is disabled. When disabled, cannot receive focus or accept input. |
FocusOrder | Nullable<Int32> | Tab order for keyboard navigation. Lower values receive focus first. If null , natural document order is used. |
Appearance | ||
BorderColor | Color | Border color when input is not focused and not disabled. |
BorderPadding | Padding | Padding between the border and the content. |
BorderStyle | BoxBorder | Style of the input border. |
DisabledBorderColor | Color | Border color when input is disabled. |
FocusedBorderColor | Color | Border color when input has focus. |
LabelColor | Color | Color of the label text. |
LabelDecoration | Decoration | Decoration style of the label text. |
PlaceholderColor | Color | Color of the placeholder text. |
PlaceholderDecoration | Decoration | Decoration style of the placeholder text. |
ValueColor | Color | Color of the input value text. |
Events | ||
OnBlur | EventCallback<FocusEventArgs> | Event callback invoked when input loses focus. |
OnFocus | EventCallback<FocusEventArgs> | Event callback invoked when input receives focus. |
OnInput | EventCallback<String> | Event callback invoked on each character input (fired for every keystroke). |
OnSubmit | EventCallback<String> | Event callback invoked when submitting input (typically by pressing Enter). |
Common | ||
ContentPadding | Padding | Padding around the input content. |
Label | String | Label text displayed above the input field. If null or empty, no label is shown. |
Value | String | Current value of the text input. Supports two-way binding with @bind-Value. |
ValueChanged | EventCallback<String> | Event callback invoked when the value changes. |
ValueExpression | System.Linq.Expressions.Expression<System.Func{System.String>} | Expression identifying the bound value for validation scenarios with EditContext. |
Other | ||
AdditionalAttributes | IReadOnlyDictionary<String, Object> | Additional HTML attributes to apply to the input element. |
Expand | Boolean | Whether the input should expand to fill available horizontal space. |
MaskInput | Boolean | Whether input characters should be masked (displayed as bullets). Useful for password fields. Default is false . |
Placeholder | String | Placeholder text shown when input is empty. |
Methods
2| Name | Type | Description |
|---|---|---|
BuildRenderTree(RenderTreeBuilder)() | Method | — |
OnParametersSet() | Method | — |