Forms, written once
Describe a licence form in TypeScript. The engine draws it, checks every answer and sends the payload your API expects.
1You write form.ts
import { defineForm } from "#form-engine";
export default defineForm({
sections: [{
key: "cafe",
title: "Café",
fields: [
{ key: "name", type: "text", label: "Name" },
{ key: "seats", type: "number", label: "Seats" },
],
}],
});2The engine draws the form
1Café
3Your API gets the payload
name:"Angkor Café"
seats:24
Type in the form and watch the payload change.
What you no longer write by hand
Each of these is one option in the form file. The engine does the rest.
Steps
stepsA step bar, Back and Continue, from a plain list of steps.
Checks
checksEvery answer is checked before the person can move on.
Conditions
whenQuestions appear only when an earlier answer calls for them.
Payload
pathAnswers are sent in exactly the shape your API expects.
Review
reviewEvery answer is read back once more before it is sent.
Drafts
restoreFilingA saved application opens again just as it was left.