Forms
@atscript/vue-form renders Vue 3 forms directly from an annotated .as type. You write the type once — labels, defaults, validation, layout, field components and submit text all flow from the same source of truth. No render boilerplate, no field-by-field wiring, no schema duplication between the form and the API contract that consumes it.
Mental model
The pipeline is three short steps:
.as type → FormDef → <AsForm>
(source) (parsed) (rendered).astype. A normal atscript interface decorated with@meta.*,@expect.*,@ui.form.*and optionally@ui.form.fn.*(dynamic). See atscript.dev for the language; see Annotations for everything vue-form reads.createAsFormDef(MyType). A one-liner that parses the type into a framework-agnosticFormDef(from@atscript/ui) and returns a reactiveformDatacontainer shaped as{ value: domainData }.<AsForm :def :form-data :types @submit>. The Tier-1 component. It walks the FormDef and dispatches each field to a Vue component from thetypesmap (defaults + your overrides).
Component tiers
Every component in vue-form lives in one of three tiers (see CLAUDE.md):
- Tier 1 — Primary. What users tag in templates:
AsForm,AsField,AsIterator. Auto-resolved byAsResolver(). - Tier 2 — Defaults. Swappable via
:typesor:components:AsInput,AsNumber,AsDecimal,AsSelect,AsRadio,AsCheckbox,AsDate,AsDatetime,AsTime,AsParagraph,AsAction,AsObject,AsArray,AsUnion,AsTuple,AsRef,AsFieldShell. Importable from@atscript/vue-form, not auto-imported. - Tier 3 — Internals. Composition helpers. Not exported.
You will spend most of your time in Tier 1 + annotations. Reach for Tier 2 when you want to replace a default renderer; reach for the types map when you want to register a brand-new field type.
Where to go next
- Hello World — a full working form in 25 lines.
- Annotations — the authoritative reference for every
@meta.*,@expect.*,@ui.form.*and@ui.form.fn.*key vue-form reads. - Field Types — the default type map and how component resolution works.
- Validation —
@expect.*, custom rules, external errors, fresh-field strategies. - Arrays, Nested Objects, Unions, Tuples — structured fields.
- Dynamic Fields —
@ui.form.fn.*JS expressions (requires@atscript/ui-fns). - Grid Layout, Actions, References — layout, submit/server actions, FK pickers.
- Customization, Custom Components, Locale — make it yours.
Related ecosystem docs
The .as language, asc CLI, @meta.*, @expect.* and validators live in the atscript core docs. The @db.* annotations (FK, currency, units, precision) are covered in the atscript-db docs. vue-form reads several of them too — see References and Annotations.