@duplojs/form
@duplojs/form
@duplojs/form is a structure-first, strongly typed form library for Vue.
Instead of wiring forms manually (value collection, validation plumbing, complex UI flows), you compose a FormField tree and let the library handle the form mechanics.
Provide your input components or use the ones already available, compose layouts, and you get a powerful form engine with reusable rendering and strong typing.
What’s inside?
createForm(...): creates a reusableuseForm(...)initializer bound to your templates.createInput(...): turns your Vue components into reusable form inputs.- Built-in layouts to model real-world forms:
useMultiLayoutuseRepeatLayoutuseUnionLayoutuseStepLayoutuseSectionLayoutuseSlotLayoutuseCheckLayoutuseDisabledLayout
- Default implementations:
@duplojs/form/vueGrid+@duplojs/form/vueGrid.css@duplojs/form/vueDesignSystem+@duplojs/form/vueDesignSystem.css
Why this approach
- Structure-first approach: define the form structure once, then compose and reuse it.
- Logic is built-in: nested layouts, complex branches, step forms, and conditional disabling.
- Design freedom: keep your own design system and visual identity.
- Contract-based inputs: if your component respects the minimal input contract, it becomes a first-class form input with
createInput(...). - End-to-end typing: from declared fields to checked output value.
Core concepts
- Inputs and layouts both return
FormField, so everything composes the same way. - A form is initialized from one root
FormField. currentValueis the live raw form state.check()executes validation for the full tree and returns checked output (or errors).- Templates control rendering only, not business logic.
- Field validation is defined through
dataParser; duringcheck(), these parsers are executed and drive validation errors/messages.
Install
npm install @duplojs/form@0 @duplojs/utils@1
Documentation
Related Packages
@schemaform/vue
Vue 3 integration for Formify — SchemaRenderer, SchemaDesigner, built-in widgets
12,287
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.0 | >=3.5.30 <4.0.0 | MIT | |
| 0.1.2 | >=3.5.30 <4.0.0 | MIT | |
| 0.1.1 | >=3.5.30 <4.0.0 | MIT | |
| 0.1.0 | >=3.5.30 <4.0.0 | MIT |
Pre-releases (3)
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.0-beta.3 | >=3.5.42 <4.0.0 | MIT | |
| 0.1.0-beta.2 | >=3.5.42 <4.0.0 | MIT | |
| 0.1.0-beta.1 | >=3.5.42 <4.0.0 | MIT |