enabledWhen()
Enables a field only when the predicate returns true. The most common rule for condition-driven gating — plan tiers, feature flags, permissions, environment checks.
Signature
Section titled “Signature”enabledWhen( field, (values, conditions) => boolean, { reason?: string | ((values, conditions) => string) },)Example
Section titled “Example”enabledWhen('companyName', (_values, conditions) => conditions.plan === 'business', { reason: 'business plan required',})Default reason
Section titled “Default reason”"condition not met"
See also
Section titled “See also”- Quick Start: enabledWhen — interactive demo
check()— bridge validators intoenabledWhenpredicates- Custom Reasons — static and dynamic reason strings