Skip to content

FieldCondition

FieldCondition<TCollectionSlug> = (props) => boolean

Defined in: packages/core/src/fields/conditions.ts:38

A pure predicate deciding whether a field is shown and validated. Runs identically on the client (reactive visibility) and the server (skips required/validate() when false) — collection files are part of the browser bundle (ADR-013). A condition that throws counts as met (true) — a failing condition must be visible, never a silent validation skip.

Exported as a standalone named type for authoring a condition function separately from a field factory call (const cond: FieldCondition<typeof TABLE_SLUG_PAGES> = ({ data }) => …); every admin.condition property itself is declared via method shorthand (not this type) for bivariant checking — see baseTypes.ts’s FieldAdminConfigInput.

TCollectionSlug extends VexResourceSlug = VexResourceSlug

FieldConditionProps<TCollectionSlug>

boolean