Introduction
Raven Form Engine is a schema-driven, adapter-based React form engine that lets you build complex forms without committing to a specific UI component library or form-state management library.
Core Philosophyβ
The engine is split into three independent layers:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β β
β <RavenForm schema={...} onSubmit={...} /> β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
βββββββββββ βββββββββββββ ββββββββββββββββ
β Schema β β FormAdapterβ β UIAdapter β
β (JSON) β β (RHF, β β (ShadCN, β
β β β Formik, β β AntD, β
β β β Zustand) β β MUI, β¦) β
βββββββββββ βββββββββββββ ββββββββββββββββ
| Layer | Responsibility |
|---|---|
| Schema | Declarative field definitions β type, label, validation, visibility, layout |
| FormAdapter | Manages form state (dirty, touched, errors, submission) |
| UIAdapter | Maps field types to actual UI components |
Key Featuresβ
- ποΈ Schema-driven β define your entire form as a plain JS/JSON object
- π Adapter-based β swap UI libs and state libs without changing your form schema
- πͺ Wizard forms β built-in multi-step forms with step validation
- π Repeater fields β dynamic rows of sub-fields
- π Conditional fields β
hiddenanddisabledcan be functions of form values - β Validation β sync and async validators, with React Hook Form support
- π Masking β composable mask pipeline
- π DevTools β floating panel with live form state inspection
Architecture Diagramβ
RavenFormProvider
βββ UIAdapterContext β provides UIAdapter to all children
βββ FormAdapterContext β provides FormAdapter to all children
βββ RavenAdapterRegistry β optional multi-adapter registry
RavenForm
βββ FormAdapter.Provider β initialises form state
β βββ RavenField β field.type β UIAdapter.components[type]
β βββ RavenField
β βββ ...
βββ Submit / Reset buttons
RavenWizardForm
βββ FormAdapter.Provider β single state across all steps
β βββ Step 1..N
β β βββ RavenField[]
β βββ Progress bar + Prev/Next navigation
βββ Submit button (last step only)
What's Includedβ
RavenFormβ single-page formRavenWizardFormβ multi-step wizard formRavenRepeaterFieldβ dynamic repeating field groupsRavenFormProvider/RavenDevToolsProviderβ app-level adapter injection- Built-in adapters: React Hook Form, ShadCN UI, Ant Design
- Utilities:
createUIAdapter,createFormAdapter, mask engine, validators
π See It In Actionβ
The Advanced Demo page shows full real-world scenarios β a 5-step wizard, conditional fields, cross-field validation, and repeater line items β all with live DevTools:
πΒ Open Advanced Demo