Overview of Superforms features
mainSuperforms is a library designed to make SvelteKit forms easier to use. Key features include:
- Validation: Supports server- and client-side validation using libraries like Zod, Valibot, Yup, Joi, TypeBox, Superstruct, Arktype, Effect, class-validator, and VineJS, or via JSON Schema.
- Data Handling: Automatically coerces
FormDatainto correct types (including arrays and files), supports nested data structures, and generates default form values from schemas. - UX Enhancements: Features auto-centering/focusing on invalid fields, tainted form detection (to prevent data loss), and real-time client-side validation.
- SvelteKit Integration: Seamlessly merges
PageDataandActionDatawith strong typing, supports multiple forms per page, and works in both standard SvelteKit and SPA modes. - Progressive Enhancement: Works without JavaScript by default but provides full support for progressive enhancement.
- Advanced Tools: Includes proxy objects for data conversion, auto-updating timers for loading states, and a
SuperDebugSvelte component for debugging.