Skip to content

Inactive Fields

Fields can be inactive through static flags or dynamic conditions.

import { predictionTransport } from "./prediction-transport";
{
id: "admin_notes",
kind: "text",
label: "Admin notes",
hiddenWhen: { kind: "field-value", field: "mode", notEquals: "review" }
}
State User can see it User can edit it Default submission behavior
hidden No No Omitted when inactive.
disabled Usually yes No Omitted when inactive.
readOnly Yes No Included 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: predictionTransport,
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.