AppForm
A schema-driven form: layout, validation and field rendering. Use v-model + a Zod schema, or a FormModel from src/lib for errors by path, touched state, server errors and submit state. A failed submit moves focus to the first invalid field, and errors clear as the user fixes them.
Install: pnpm add-component Fields/AppForm
User profile
A multi-row form for collecting personal information.
Contact & location
Using specialized inputs like Phone and Select.
Account security
Password fields and authentication layout.
Event details
Date selection and specialized inputs.
Resource upload
Handling single and multiple file uploads with live status and removal.
Validation with a FormModel
Submit it empty: errors appear and focus moves to the first invalid field; they clear as you fix them. taken@example.com comes back with a server error on the email field.
API
modelValue(Record<string, any>): The form data object (v-model).formModel(FormModel): A FormModel from src/lib/FormModel.ts; takes precedence over v-model + schema. Its errors are keyed by path (address.city); setErrors() takes server errors; errorFor(path) waits for touch or submit.fields(FormFieldRow[]): Schema defining rows and field configurations.schema(ZodType): Optional Zod schema for automatic validation (v-model path).fieldGap(string): Spacing between fields.rowClass(string): Extra classes applied to each field row.