Form guardrails
Form system guardrails — useFormDynamic, Form, validateFormData. Procedures in skill aura-forms.
Aura form guardrails
Installation
pnpm dlx shadcn@latest add @aura/rule-components-formsForms use useFormDynamic for state, Form for error distribution, and validateFormData from @/utils/web-validation. Schema property names must match field names so errors match by instancePath.
- MUST: Build forms with
useFormDynamic(initialValues, formRef?)and pass fields fromgetFields()/field(name)into Form field components. - MUST: Validate with
validateFormData(schema, formData.getValues())and pass returnederrorsto<Form>. On failure callformData.touchForm(). - MUST: Use Form field components (
FormField,FormSwitch,FormCheckbox, groups) per control type; do not passerrorsinto each field. - MUST: Keep editable controls ≥ 17px (see typography guardrails). Do not override control padding via call-site
className. - SHOULD: Use
FormAlertfor form-level errors whenfetchStatus === "error".
Procedures and full submit examples live in skill aura-forms.