Skip to content

Inactive Fields

Fields can be inactive through static flags or dynamic conditions.

{
id: "admin_notes",
kind: "text",
label: "Admin notes",
hiddenWhen: { kind: "field-value", field: "mode", notEquals: "review" }
}
StateUser can see itUser can edit itDefault submission behavior
hiddenNoNoOmitted when inactive.
disabledUsually yesNoOmitted when inactive.
readOnlyYesNoIncluded unless also hidden or disabled.

The kit default is inactiveFieldPolicy: "omit". That keeps backend payloads focused on active user choices.

Use inactiveFieldPolicy: "include" when the backend must receive the full state snapshot.

mountForm(container, {
transport: createJsonTransport({ endpoint: "/api/predict" }),
schema,
inactiveFieldPolicy: "include",
});
  • Use hiddenWhen for branch-specific fields.
  • Use disabledWhen when the user should understand why a value is unavailable.
  • Use readOnlyWhen for review mode or locked data.
  • Keep backend validation aligned with the chosen inactive field policy.