Behavior

Validation

A step must be valid before forward navigation or completion. Backward navigation never validates the current step.

Required and optional fields

A field is required only when required === true. An absent flag and required: false are equivalent. Optional empty values pass validation; optional non-empty values still follow their type rules.

{ name: 'name', type: 'text', label: 'Name', required: true }
{ name: 'email', type: 'email', label: 'Email' } // optional

Whitespace detail: v0.1.1 considers only '', null, and undefined empty. A whitespace-only text value therefore passes required validation.

Rules by field type

Type Empty Non-empty rule
text / textarea Passes unless required Must be a string
email Passes unless required Must match the built-in basic email pattern
number Passes unless required Must be a finite JavaScript number; numeric strings fail
select Passes unless required Must equal one declared option value
checkbox false passes only when optional Must be boolean; required means it must be true

Try validation

Submit empty, then enter an invalid optional email. This form runs the compiled Demetria package code.

Interactive contact form
Complete the form to inspect its values.

Current limits

Validation messages are built in and English-only. v0.1.1 has no custom validators, asynchronous validation, cross-field rules, or server-error API. Validate again on the server for every submission; browser validation is a usability feature, not a security boundary.