Conditional Logic

Form with showIf, disabledIf, readOnlyIf, and requiredIf predicates.

How It Works

All predicate functions receive the current form values and return a boolean:

showIf: (values) => values.mode === "advanced";

In this example:

  • showIf – Email field only appears in Advanced mode
  • disabledIf + readOnlyIf – Notes field is locked in Basic mode
  • requiredIf – Email becomes required only in Advanced mode

Toggle the Mode radio to see the conditional behaviour in action.

See Conditional Predicates for all available predicates.

On this page