Getting Started
#
Introduction- Formst is the new way to create and handle forms. Unlike most form libraries that are UI-first, Formst is data first. It is based on MST(MobX-State-Tree). This library helps you create high-performance forms with interdependent fields within tables and add validations.
Note: Formst has peer dependencies and requires mobx, mobx-react-lite/mobx-react and mobx-state-tree.
#
InstallationUse yarn or npm to install this library:
#
Basic UsageCreate a form model:
Create an instance of the model:
Wrap the components inside Formst and use Field API to render the fields:
Optional: If you don't like
Field
API, you can directly plug this to an element.Note: For this to work, you need to wrap the entire component inside observer.