A component that provides labeling and validation for form controls.
Visible on your profile
Anatomy
Import the primitives and assemble the parts:
@using Blazix.Primitives
<FieldRoot>
<FieldLabel />
<FieldControl />
<FieldDescription />
<FieldItem />
<FieldError />
<FieldValidity />
</FieldRoot>
A field labels and describes its control, and validates it: with the browser's constraint validation (attributes such
as required and pattern), a Validate function, or both.
ValidationMode chooses when it validates: on submit, on blur, or on every change. It defaults to the
form's mode, or to on submit.
FieldError shows its message while the field is invalid, or only for the constraint its
Match names.
API Reference
FieldRoot
Renders a <div> element.
Other attributes are passed to the element it renders.
FieldLabel
Renders a <label> element.
Other attributes are passed to the element it renders.
FieldControl
Renders a <input> element.
Other attributes are passed to the element it renders.
FieldDescription
Renders a <p> element.
Other attributes are passed to the element it renders.
FieldItem
Renders a <div> element.
Other attributes are passed to the element it renders.
FieldError
Renders a <div> element.
Other attributes are passed to the element it renders.
FieldValidity
Doesn't render its own HTML element.