form
Form
Validates its fields on submit, against their own rules or one Standard Schema such as Zod 4, hands over their values, and shows server errors on the field they name.
States: Default
Parts
| Part | File | Does |
|---|---|---|
| Form | Form.vue | Validates its fields on submit, hands over their values, and shows server errors on the field they name. |
Styling
| Part | Recipe |
|---|---|
| Form | form |
Install
Writes 3 files into components/ui/form/. For agents, npx @frontic/ui docs form prints this reference as markdown; the MCP server serves the same.
- Installs with it
- field
- npm packages
- @standard-schema/spec
- @vueuse/core
- reka-ui
Built from
API reference
Form Form.vue
Validates its fields on submit, hands over their values, and shows server errors on the field they name. Renders a <form>.
| Prop | Type | Default | |
|---|---|---|---|
| errors | Record<string, string | string[]> | — | |
| validationMode | FieldValidationMode | 'onSubmit' | |
| asChild | boolean | false | |
| as | AsTag | Component | 'form' | |
| class | ClassValue | — | |
| schema | StandardSchema | — | |
| Event | Payload | |
|---|---|---|
| submit | event: SubmitEvent | |
| formSubmit | values: Record<string, unknown>, event: SubmitEvent | |
| Slot | Slot props | |
|---|---|---|
| default | { errors: string[]; } | |
| Recipe form | Sets | |
|---|---|---|
| base: form | 4 properties | |
Example