Class BOBInputText
- Namespace
- BlazOrbit.Components.Forms
- Assembly
- BlazOrbit.dll
[GenerateComponentInfo]
public class BOBInputText : BOBInputComponentBase<string, BOBInputText, BOBInputVariant>, IHasReadOnly, IHasDisabled, IHasRequired, IHasError, IVariantComponent<BOBInputVariant>, IVariantComponent, IBuiltComponent, IHasSize, IHasLoading, IHasDensity, IHasShadow, IHasColor, IHasBackgroundColor, IHasPrefix, IHasSuffix, IInputFamilyComponent
- Inheritance
-
objectComponentBaseInputBase<string>BOBInputComponentBase<string>BOBInputText
- Implements
- Inherited Members
Constructors
BOBInputText()
public BOBInputText()
Properties
BackgroundColor
Background color of the input. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? BackgroundColor { get; set; }
Property Value
- string
BuiltInTemplates
protected override IReadOnlyDictionary<BOBInputVariant, Func<BOBInputText, RenderFragment>> BuiltInTemplates { get; }
Property Value
- IReadOnlyDictionary<BOBInputVariant, Func<BOBInputText, RenderFragment>>
Color
Text color of the input. Accepts any valid CSS color value, PaletteColor or BOBColor.
[Parameter]
public string? Color { get; set; }
Property Value
- string
DefaultVariant
Default variant used when no explicit variant is specified.
public override BOBInputVariant DefaultVariant { get; }
Property Value
Density
Vertical density (gap) of the input.
[Parameter]
public BOBDensity Density { get; set; }
Property Value
HelperText
Helper text displayed below the input for additional context.
[Parameter]
public string? HelperText { get; set; }
Property Value
- string
Label
Floating label displayed above the input when it has a value or focus.
[Parameter]
public string? Label { get; set; }
Property Value
- string
Loading
When true, the input shows a loading indicator.
[Parameter]
public bool Loading { get; set; }
Property Value
- bool
LoadingIndicatorVariant
[Parameter]
public BOBProgressIconVariant LoadingIndicatorVariant { get; set; }
Property Value
OnInput
Raised on every keystroke when UpdateOnInput is enabled.
[Parameter]
public EventCallback<string> OnInput { get; set; }
Property Value
- EventCallback<string>
OnInputDebounceMs
Trailing-edge debounce delay applied to OnInput only. When
greater than 0, the callback fires after this many milliseconds of
keyboard inactivity, coalescing burst keystrokes into a single invocation —
the standard search-as-you-type pattern. 0 disables debouncing
(default). UpdateOnInput is unaffected: when enabled, the
bound Microsoft.AspNetCore.Components.Forms.InputBase<TValue>.Value still propagates immediately
per keystroke.
[Parameter]
public int OnInputDebounceMs { get; set; }
Property Value
- int
Placeholder
Placeholder text shown when the input is empty.
[Parameter]
public string? Placeholder { get; set; }
Property Value
- string
PrefixBackgroundColor
Background color of the prefix area.
[Parameter]
public string? PrefixBackgroundColor { get; set; }
Property Value
- string
PrefixColor
Color of the prefix text or icon.
[Parameter]
public string? PrefixColor { get; set; }
Property Value
- string
PrefixIcon
Material icon name displayed before the input value.
[Parameter]
public IconKey? PrefixIcon { get; set; }
Property Value
PrefixText
Text displayed before the input value.
[Parameter]
public string? PrefixText { get; set; }
Property Value
- string
Shadow
Shadow style applied to the input container.
[Parameter]
public ShadowStyle? Shadow { get; set; }
Property Value
Size
Visual size of the input.
[Parameter]
public BOBSize Size { get; set; }
Property Value
SuffixBackgroundColor
Background color of the suffix area.
[Parameter]
public string? SuffixBackgroundColor { get; set; }
Property Value
- string
SuffixColor
Color of the suffix text or icon.
[Parameter]
public string? SuffixColor { get; set; }
Property Value
- string
SuffixIcon
Material icon name displayed after the input value.
[Parameter]
public IconKey? SuffixIcon { get; set; }
Property Value
SuffixText
Text displayed after the input value.
[Parameter]
public string? SuffixText { get; set; }
Property Value
- string
UpdateOnInput
When true, the bound value is updated on every keystroke instead of only on blur.
[Parameter]
public bool UpdateOnInput { get; set; }
Property Value
- bool
Methods
BuildComponentCssVariables(Dictionary<string, string>)
Contributes additional CSS custom properties to the inline style attribute. Keys
that collide with framework-owned --bob-inline-* variables will be overwritten.
public void BuildComponentCssVariables(Dictionary<string, string> cssVariables)
Parameters
cssVariablesDictionary<string, string>
BuildComponentDataAttributes(Dictionary<string, object>)
Contributes additional data- attributes to the root element. Keys that collide
with framework-owned data-bob- attributes will be overwritten.
public void BuildComponentDataAttributes(Dictionary<string, object> dataAttributes)
Parameters
dataAttributesDictionary<string, object>
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
DisposeAsync()
Async disposal path. Blazor invokes this first when the component is unmounted because the type implements System.IAsyncDisposable; it tears down the JS-side behavior instance via BlazOrbit.Abstractions.BOBComponentPipeline.DisposeBehaviorAsync().
public override ValueTask DisposeAsync()
Returns
- ValueTask
Remarks
Both this method and Dispose(bool) run on disposal — Blazor calls
DisposeAsync for the async work and the framework's System.IDisposable
contract still invokes Dispose(true) afterward. The split is intentional:
async work (JS interop teardown) lives here, sync work (event unsubscribe) lives in
Dispose(true). Both set IsDisposed so derived components can
guard post-await continuations regardless of which path runs first.
TryParseValueFromString(string?, out string, out string?)
Parses a string to create an instance of string. Derived classes can override this to change how Microsoft.AspNetCore.Components.Forms.InputBase<TValue>.CurrentValueAsString interprets incoming values.
protected override bool TryParseValueFromString(string? value, out string result, out string? validationErrorMessage)
Parameters
valuestringThe string value to be parsed.
resultstringAn instance of string.
validationErrorMessagestringIf the value could not be parsed, provides a validation error message.
Returns
- bool
True if the value could be parsed; otherwise false.