Class TwBlazorTextInputComponentBase
- Namespace
- TwBlazor
- Assembly
- TwBlazor.dll
Base class for input components styled via InputVariant (Default, Outlined, Filled) - text-editable "textfield-shaped" controls (TwTextfield<T>, TwSelect<T>, TwColorPicker) and the popover pickers built on top of a textfield trigger (TwDatePicker, TwTimePicker, TwDateTimePicker).
public abstract class TwBlazorTextInputComponentBase : TwBlazorInputComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent, ITwInputComponent, IAsyncDisposable
- Inheritance
-
TwBlazorTextInputComponentBase
- Implements
- Derived
-
TwTextfield<T>
- Inherited Members
Remarks
Deliberately narrower than TwBlazorInputComponentBase: other inputs derived from that
base (checkboxes, radio buttons, switches, sliders, progress bars, file upload) have no
Default/Outlined/Filled textfield concept, and one of them (TwFileUpload)
already exposes its own unrelated Variant (a ButtonVariant) - Blazor's parameter
binding rejects two same-named parameters on one component even when one hides the other via
new, so Variant can't live on the shared input base without colliding there.
Constructors
TwBlazorTextInputComponentBase()
protected TwBlazorTextInputComponentBase()
Properties
Dense
Gets or sets whether the input uses a more compact height and text size, useful when screen space is limited.
[Parameter]
public bool Dense { get; set; }
Property Value
Remarks
The height and text size come from Size and DenseSize, shared by every single-line input so they all line up. Not applied to a multi-select (Multiple), whose height is driven by its selected chips.
Variant
Gets or sets the visual variant of the input control (Default, Outlined, Filled).
[Parameter]
public InputVariant? Variant { get; set; }
Property Value
Remarks
If not set, uses the global default from DefaultInputVariant - see effectiveVariant.
effectiveDense
Gets whether the input uses the compact size: Dense is set, or the TwInputGroup it sits in is Dense.
protected bool effectiveDense { get; }
Property Value
effectiveVariant
Gets the effective input variant to use: Variant when explicitly set by the consumer, otherwise the global default configured via DefaultInputVariant.
protected InputVariant effectiveVariant { get; }
Property Value
inputGroupControlClasses
Gets the classes added to the input's control after its variant classes while it sits in a TwInputGroup, removing the border, background, rounding, padding and focus ring the group draws instead, or an empty string outside a group.
protected string inputGroupControlClasses { get; }
Property Value
inputSizeClasses
Gets the height and text size classes for a single-line input: DenseSize when Dense is set, otherwise Size.
protected string inputSizeClasses { get; }
Property Value
isInInputGroup
Gets whether the input sits in a TwInputGroup, which then draws its border, background, rounding and focus ring.
protected bool isInInputGroup { get; }
Property Value
surfaceVariant
Gets the input variant whose surface the control's field draws. Inside a TwInputGroup this is the group's variant (the group draws the field's border and background), otherwise the control's own effectiveVariant.
protected InputVariant surfaceVariant { get; }
Property Value
Methods
GetDescribedBy(string?)
Joins the control's own aria-describedby ids with those of the TwInputGroupTexts in the
TwInputGroup it sits in.
protected string? GetDescribedBy(string? ownIds)