TextInput

Class

For examples and usage details, see the component documentation.

View TextInput Component
Namespace: RazorConsole.Components
Assembly: RazorConsole.Core

Definition

public class TextInput : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender

Constructors

1
NameTypeDescription
TextInput()Constructor—

Properties

27
NameTypeDescription
Behavior
DisabledBooleanWhether the input is disabled. When disabled, cannot receive focus or accept input.
FocusOrderNullable<Int32>Tab order for keyboard navigation. Lower values receive focus first. If null, natural document order is used.
Appearance
BorderColorColorBorder color when input is not focused and not disabled.
BorderPaddingPaddingPadding between the border and the content.
BorderStyleBoxBorderStyle of the input border.
DisabledBorderColorColorBorder color when input is disabled.
FillHeightBooleanWhether the input should fill the height offered by its parent.
FillWidthBooleanWhether the input should fill the width offered by its parent.
FocusedBorderColorColorBorder color when input has focus.
LabelColorColorColor of the label text.
LabelDecorationDecorationDecoration style of the label text.
PlaceholderColorColorColor of the placeholder text.
PlaceholderDecorationDecorationDecoration style of the placeholder text.
ValueColorColorColor of the input value text.
Events
OnBlurEventCallback<FocusEventArgs>Event callback invoked when input loses focus.
OnFocusEventCallback<FocusEventArgs>Event callback invoked when input receives focus.
OnInputEventCallback<String>Event callback invoked on each character input (fired for every keystroke).
OnSubmitEventCallback<String>Event callback invoked when submitting input (typically by pressing Enter).
Common
ContentPaddingPaddingPadding around the input content.
LabelStringLabel text displayed above the input field. If null or empty, no label is shown.
ValueStringCurrent value of the text input. Supports two-way binding with @bind-Value.
ValueChangedEventCallback<String>Event callback invoked when the value changes.
ValueExpressionSystem.Linq.Expressions.Expression<System.Func{System.String>}Expression identifying the bound value for validation scenarios with EditContext.
Other
AdditionalAttributesIReadOnlyDictionary<String, Object>Additional HTML attributes to apply to the input element.
ExpandBooleanWhether the input should expand to fill available horizontal space.
MaskInputBooleanWhether input characters should be masked (displayed as bullets). Useful for password fields. Default is false.
PlaceholderStringPlaceholder text shown when input is empty.

Methods

2
NameTypeDescription
BuildRenderTree(RenderTreeBuilder)()MethodRenders the component to the supplied RenderTreeBuilder.
OnParametersSet()MethodMethod invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.