Form
A native form with consolidated error handling. Submit https://example.com in the demo to see a mapped field error. color passes through to descendant fields.
Anatomy
<UiForm :errors="errors" @form-submit="onSubmit">
<UiFieldRoot name="url">
<UiFieldLabel>Homepage</UiFieldLabel>
<UiFieldControl type="url" required />
<UiFieldError />
</UiFieldRoot>
<UiButton type="submit">Submit</UiButton>
</UiForm>
Parts
- Form — native
<form novalidate>.errorsis a map of fieldnameto message.@form-submitreceives the values as an object after client validation passes. - Field —
namemust match theerrorskey. EmptyErrorshows the native or server message.
validationMode defaults to onSubmit, then fields re-validate on change. Use UiButton with type="submit" — the default button type does not submit.