cnc-form-renderer
Renders a form from a JSON layout — the same JSON a cnc-form-builder export
produces. It is the runtime half of the builder pair, and the widget
cnc-wizard
uses for each of its steps.
Quick start
Bind a layout and a data object. Fields write their values into
data
under each field's name, so reading the answers is reading that object —
there is nothing to collect.
<cnc-form-renderer :layout="layout" :data="data"></cnc-form-renderer>
Usage guidance
Reach for it when forms are DATA in your system — user-defined questionnaires, per-tenant
intake forms, anything an administrator edits without a release. For a form you write once,
ordinary cnc-input and cnc-select markup inside a
cnc-form
is simpler to read and to debug.
The data object is the interface in both directions: seed it to prefill, read it to
submit. Give each renderer its own, since fields write into it directly.
Validation is yours. The renderer displays whatever you put in errors and enforces
nothing itself — which is how cnc-wizard gates its steps, by walking the same
layout and checking required fields before allowing a move.
Pair it with cnc-form-builder, which produces these layouts through a visual
editor. The two are one feature split across two widgets.