Basics/Your first form

Basics

Your first form

Every licence a business applies for is a form, and every form is a TypeScript file that says what to ask. The engine draws it, checks each answer, and turns the answers into the payload an API expects.

On the right is a form for a café licence. It has one section, a card called Café, with no questions yet.

A field needs three things:

  • key, the name the API uses for the answer
  • type, what kind of answer it is
  • label, the question people read

Add the café's name to the section:

fields: [
  { key: "name", type: "text", label: "Café name" },
],

A form of sections is one page: every card, then a Submit button in your app. Here the preview leaves Submit out; press Check when you think the form is right. Later you will split a long form into steps.

Up nextField types