Pages and steps

Pages and steps

Sections make a page. Steps make a wizard.

A page

A form of sections is one page: every card, then a Submit button that checks them all.

export default defineForm({
  sections: [cafe, contact],
});

Add review: true to show a review before it is sent.

A wizard

A form of steps shows a step bar, Back and Continue, and a review step at the end.

export default defineForm({
  steps: [
    { key: "business", title, sections: [cafe] },
    { key: "safety", title, sections: [fire] },
  ],
});

A form has sections or steps, never both.

A step only sometimes

A step takes when, naming fields as section.field. A hidden step is not asked, not sent and not reviewed.

{
  key: "kitchen",
  title,
  when: { field: "cafe.serves_food", equals: true },
  sections: [kitchen],
}

Defaults

  • A field is required unless it says optional: true.
  • Its width follows its type; width changes it.
  • newRow: true starts a field on a new row.