Skip to content
GitHub11 stars

A native input element that automatically works with Field.

<label class="input-label">
    Name
    <InputRoot placeholder="e.g. Colm Tuite" class="input" />
</label>

Usage guidelines

  • Form controls must have an accessible name: give it one with a <label> element or the Field parts.

Anatomy

Import the primitives and use the part:

@using Blazix.Primitives

<InputRoot />

API Reference

InputRoot

Renders a <input> element.

ParameterTypeDefault
Value string? -
ValueChanged

Called with the new value when Value changes, for @bind-Value.

EventCallback<string?> -
OnValueChange

Runs before the value changes, with the reason; call Cancel() to keep it.

EventCallback<ValueChangeEventArgs<string?>> -
Disabled

Whether the component should ignore user interaction.

bool false
Render RenderFragment<FieldRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.

AttributeType
data-disabled

Present when the input is disabled.

-
data-valid

Present when the input is in a valid state (when wrapped in FieldRoot).

-
data-invalid

Present when the input is in an invalid state (when wrapped in FieldRoot).

-
data-dirty

Present when the input's value has changed (when wrapped in FieldRoot).

-
data-touched

Present when the input has been touched (when wrapped in FieldRoot).

-
data-filled

Present when the input is filled (when wrapped in FieldRoot).

-
data-focused

Present when the input is focused (when wrapped in FieldRoot).

-