vael-ui v0.5.7

vael-form

Forms

vael-form is a separate, optional package for forms on a schema: Zod, Valibot, ArkType or any Standard Schema library. You keep v-model, and it adds the errors, the accessibility wiring and the submit. It works with vael-ui, with plain inputs and with any other component library.

Install

It needs Vue 3.5 or later, and nothing from vael-ui. Add the schema library you use.

pnpm add vael-form zod

One form

One schema holds the rules. Each input gets three things, all by the field’s name: v-model for the value, attrs for its id, ARIA and blur, and errors for the message.

Why vael-form

  • Vue first. Fields are refs, so v-model works on inputs, groups and lists, in VDOM and in Vapor.
  • Accessible by default. attrs sets aria-invalid and aria-describedby, and a failed submit focuses the first invalid field.
  • Errors at the right moment. An error shows once a field is changed and left, not while you pass over it. Autofill and a click on a moving button are handled.
  • Translated with your catalog. Schema errors look up keys in your own locale files and follow a locale switch without validating again.
  • Small. About 8 KB gzipped. Rules, the message catalog and schema limits load only when a form uses them.

The guide