Components
← All components

Conditional Fields

stimeo--conditional-fields

Shows/hides and enables/disables regions based on a trigger control's value.

The stimeo--conditional-fields controller watches trigger controls and shows or hides regions whose condition holds, keeping hidden, aria-hidden, and disabled in sync. Each region declares its condition with data-when-checked, data-when-unchecked, or data-when-value="x"; with multiple triggers, match (any/all) combines them. While hidden, a region's inputs are disabled (when disableHidden) so they drop out of the submission, and hiding a region that holds focus first retreats focus to a trigger. It re-derives state from the triggers on connect (Morph-safe) and dispatches stimeo--conditional-fields:change. Behavior only — no styling is applied.

running