Types
Every public type exported by notform, with its shape and where it is used.
All types are exported from notform and are available through TypeScript in both Vue and Nuxt projects. In Nuxt, add notform as a direct dependency to import them. See Nuxt module.
Schema types
| Type | Description |
|---|---|
FormSchema | A Standard Schema whose input and output are both objects. The constraint useForm places on schema. |
SchemaInput<TSchema> | The data the schema accepts: the shape of form.values. |
SchemaOutput<TSchema> | The data the schema produces: the shape onSubmit receives. |
Form types
| Type | Description |
|---|---|
FormConfig<TSchema> | The options object accepted by useForm: schema, initialValues, initialErrors, onSubmit. |
UseFormInstance<TSchema> | The public form instance returned by useForm. Use this to type props and variables that hold a form. |
FormInstance<TSchema> | The wider form type, including members that are not part of the public contract. Prefer UseFormInstance. |
FormProps<TSchema>/ FormSlots | Props and slots of Form. |
Field types
| Type | Description |
|---|---|
FieldConfig | Per-field behavior, passed to form.field() and form.arrayField(). |
FieldEvents | The handlers in field.events. |
FieldValidationEvent | 'blur' | 'change' | 'input'. |
FieldInstance<TValue> | A field bound to one value. |
FieldProps<TValue> / FieldSlots<TValue> | Props and slots of Field. |
FieldErrorProps / FieldErrorSlots | Props and slots of FieldError. |
Array field types
| Type | Description |
|---|---|
ArrayFieldInstance<TItem> | A FieldInstance<TItem[]> plus items, append, prepend, insert, remove, move, swap, update. |
ArrayItemInstance<TItem> | One item. A FieldInstance<TItem> plus index, field(path, config?), and arrayField(path, config?). |
ArrayFieldProps<TItem> / ArrayFieldSlots<TItem> | Props and slots of ArrayField. |
ArrayItem<TArray> | The item type of an array type. |
Path types
| Type | Description |
|---|---|
InputPath<TSchema> | Every valid dot-notation path into the input. |
InputArrayPath<TSchema> | Input paths that point at an array. |
InputPathValue<TSchema, TPath> | The input type at a path. |
OutputPath<TSchema> | Every valid path into the output. |
OutputPathValue<TSchema, TPath> | The output type at a path. |
Path types recurse to a depth of 10.
Validation types
| Type | Description |
|---|---|
ValidationIssue | A Standard Schema issue: { message: string, path?: ReadonlyArray<PropertyKey | { key: PropertyKey }> }. |
ValidationResult<TValue> | { value: TValue } on success, { issues } on failure. Returned by form.validate() and field.validate(). |
useForm
Create a typed reactive form from a Standard Schema-compatible object schema. Full configuration and instance reference.
Troubleshooting
Fix the most common NotForm problems; errors that do not show or clear, ignored config, submit that does nothing, array glitches, and Nuxt auto-import issues.