Skip to content
GitHub11 stars

A native form element with consolidated error handling.

<FormRoot Errors="_errors" OnFormSubmit="SubmitAsync" class="form">
    <FieldRoot Name="url" class="form-field">
        <FieldLabel class="form-label">

Anatomy

Import the primitives and assemble the parts:

@using Blazix.Primitives

<FormRoot>
    <FieldRoot>
        <FieldLabel />
        <FieldControl />
        <FieldError />
    </FieldRoot>
</FormRoot>

API Reference

FormRoot

Renders a <form> element.

ParameterTypeDefault
ValidationMode ValidationMode ValidationMode.OnSubmit
Errors IReadOnlyDictionary<string, IReadOnlyList<string>>? -
OnFormSubmit EventCallback<IReadOnlyDictionary<string, object?>> -
Render RenderFragment<PartRenderProps>? -
ChildContent

The part's content.

RenderFragment? -

Other attributes are passed to the element it renders.