Table of Contents

Class TwInputRoot

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

Used for all input components to wrap the input element and provide a consistent root element for styling and attributes.

public class TwInputRoot : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance
TwInputRoot
Implements
Inherited Members

Constructors

TwInputRoot()

public TwInputRoot()

Properties

ChildContent

The input element is rendered as a child of this component, allowing it to apply consistent styling and attributes to the root element. The ChildContent parameter is used to render the input element within the TwInputRoot component.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

RootAriaLabel

Optional ARIA label for the root element.

[Parameter]
public string? RootAriaLabel { get; set; }

Property Value

string

RootAriaLabelledBy

Optional ARIA labelledby attribute for the root element.

[Parameter]
public string? RootAriaLabelledBy { get; set; }

Property Value

string

RootAttributes

The additional attributes applied to the root element.

[Parameter]
public required Dictionary<string, object>? RootAttributes { get; set; }

Property Value

Dictionary<string, object>

RootClass

The classes applied to the root element.

[Parameter]
public required string? RootClass { get; set; }

Property Value

string

RootErrorId

The id applied to the rendered error message element. Must match the id the input component passes to its own aria-describedby for the association to work.

[Parameter]
public string? RootErrorId { get; set; }

Property Value

string

RootErrorMessage

Optional validation error message. Rendered below the input, with the id RootErrorId so the input's aria-describedby can reference it, only while RootErrorId is also set.

[Parameter]
public string? RootErrorMessage { get; set; }

Property Value

string

Remarks

Input components only set RootErrorId while they are invalid, so a message passed alongside Invalid="false" stays hidden rather than showing without being linked to the input.

RootId

The id of the root element.

[Parameter]
public required string RootId { get; set; }

Property Value

string

RootRef

The reference to the root DOM element. Set internally via @ref on the rendered div. Consumers capture this by holding a @ref to the TwInputRoot component instance.

public ElementReference RootRef { get; }

Property Value

ElementReference

RootStyle

Optional inline style for the root element.

[Parameter]
public string? RootStyle { get; set; }

Property Value

string

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose()

public void Dispose()

Dispose(bool)

Unreports the input's validation message from its group.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

OnParametersSet()

Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

protected override void OnParametersSet()