v1.6.0
π New Components
Form
Centralized form validation and submission β full parity with Nuxt UI v4's Form component.
- Schema validation β Zod 3.24+, Valibot 1.0+, Yup 1.7+ (via Standard Schema) and Joi 17+ (dedicated adapter). Pass any schema directly to the
schemaprop β zero adapters needed - Custom validate β Sync or async function, runs alongside schema if both provided
- Field-level validation β Triggers on blur / input / change / focus with configurable debounce (
validateOnInputDelay) and eager-after-first-blur semantics - Dirty / touched / blurred tracking β Reactive
SvelteSet-based field tracking withdirty,dirtyFields,touchedFields,blurredFieldsgetters - Loading auto-disable β
loadingAuto(defaulttrue) flipsloadingduring async submit; double-submit guard via#submittingflag works even withloadingAuto: false - Nested forms β
<Form nested name="address">attaches to parent;submit()cascades validation,setErrors()/clear()/reset()cascade too. Errors prefixed with child path - Schema transform output β Zod
.transform(), Valibot pipe transforms etc. applied on submit whentransform: true - Full programmatic API via
bind:apiβsubmit(),validate(),clear(),reset(),setErrors(),getErrors()+ reactiveerrors,loading,disabled,dirty,submitCount - Error summary β Read
form.errorsreactively to render error lists - 9 interactive demo examples β Basic Zod login, schema lib comparison (Zod/Valibot/Yup/Joi tabs), async submit, programmatic API, async username check, array repeater with nested forms per row, dependent fields (Zod refine), nested address form, error summary + reset
π οΈ New Utilities
useFormFieldEmit()β Helper hook for custom input components to emit form events (blur, input, change, focus) to the parent FormwireFormEvents()β Convenience wrapper that merges emit calls with user-supplied event handlers for custom input wrappersFORM_FIELD_CONTEXT_KEYβ Exported Symbol for the FormField context (replaces string key)getFormContext()β Access the parent Form context from custom componentsInputValuetype +InputProps<T extends InputValue>β Generic type for type-safebind:valueinference (string | number | bigint | boolean | null | undefined)
β‘ Changed
- 10 input components (Input, Textarea, Select, SelectMenu, Checkbox, CheckboxGroup, RadioGroup, Switch, PinInput, Slider) β wired up form event emission via
useFormFieldEmit. CheckboxGroup and RadioGroup fire focus/blur on the fieldset wrapper. Backward-compatible: no-op when used outside a Form - FormField β Context key migrated from string
'formField'to exported SymbolFORM_FIELD_CONTEXT_KEY
π¦ Dependencies
- Added
@standard-schema/spec(runtime dependency, types-only, zero bundle cost) - Added optional peer dependencies:
zod ^3.24.0 || ^4.0.0,valibot ^1.0.0,yup ^1.7.0,joi ^17.0.0 || ^18.0.0(all optional β user installs whichever they prefer) - Added
zod,valibot,yup,joias devDependencies (for integration tests + demo)
π Stats
- 2112 tests passing across 53 test files
- 92 new tests for Form component (44 context unit, 24 validate-schema, 13 real-library integration with Zod/Valibot/Yup/Joi, 11 browser component)
- 0 type errors, 0 lint errors