Introduction
This is a general form library with a simple focus and validation management.
The form API is designed for the best type-safety and flexibility. Instead of setting up the form state with a single object, each field is created separately, giving you the ability to fine-tune each field perfectly. As the field and its meta statuses are stored in atoms, you can easily combine them, define hooks, and effects to describe any logic you need.
The cherry on the cake is dynamic field management. You don’t need to use awkward string-based APIs like form.${index}.property. Instead, you work with actual objects that support straightforward interface definitions and seamless interaction at both the type-level and runtime.
The forms API is composed of the following primitives:
reatomField: a simple yet powerful and flexible field model that encapsulates multiple related states and methodsreatomFieldArray: a primitive for dynamic field arrays that enables adding, removing, and reordering fields with a linked-list-like data structurereatomFieldSet: an aggregation primitive that combines multiple fields and manages them collectivelyreatomForm: the form primitive itself - combiningreatomFieldSet, schema-based validation, and submission functionality
By combining these primitives, you can construct form models of any complexity while maintaining framework agnosticism, simplifying testing, and achieving unprecedented levels of performance and flexibility.