Form / foldkit-form

Limits and guards from a metakit declaration

When your input Schema's rules are written with metakit, foldkit-form/metakit reads them instead of you repeating them in the view. Declared.of(form) gives each key the min, max, step and type its bounds and domain type imply, and can(model, transition, state) says whether a guarded transition would go through with what has been typed so far. field(model, key) shows a rule over several keys beside each key it reads as soon as the values break it. Declared.inputs(schema) gives money and calendar days controls that read them. See Take a form's limits and guards from its metakit declaration.

Limits

  • Headless: draw forms with foldkit-mixins-form or your own renderer over controls, and fetch relation picker options via a query (or foldkit-crud).
  • Draft type safety: Changed accepts any draft value; drafts of the wrong type for a key are ignored rather than stored.
  • Struct values and row order: struct fields edit via Relation.nested or Input.bundle; nested rows keep insertion order without built-in reordering.
  • Bundle-backed controls: omit OutMessage, command services, and check options; inside nested rows, omit Subscriptions and Resources.

Next