Skip to main content

boolean Field Type

type: 'boolean' casts the field value with Boolean() and displays booleanTrueLabel or booleanFalseLabel. Defaults are 'Yes' and 'No'. Any truthy value renders as true; any falsy value renders as false.

Core Examples​

Default Labels​

Three boolean fields with no custom labels. True → 'Yes', false → 'No'.

Name
Active
Verified
Admin
Aurora ChenYesYesNo
Mateo SilvaNoYesNo
Priya NairYesNoYes
fields: [
{ key: 'active', label: 'Active', type: 'boolean' },
{ key: 'verified', label: 'Verified', type: 'boolean' },
{ key: 'admin', label: 'Admin', type: 'boolean' },
]

Custom Labels​

booleanTrueLabel and booleanFalseLabel replace the default Yes/No text. Any string is accepted — including emoji or symbols.

Each boolean field uses domain-specific labels instead of Yes/No.

Name
Status
Verified
Role
Aurora ChenActive✓ VerifiedMember
Mateo SilvaInactive✓ VerifiedMember
Priya NairActive✗ UnverifiedAdmin
{
key: 'active',
label: 'Status',
type: 'boolean',
booleanTrueLabel: 'Active',
booleanFalseLabel: 'Inactive',
},
{
key: 'verified',
label: 'Verified',
type: 'boolean',
booleanTrueLabel: '✓ Verified',
booleanFalseLabel: '✗ Unverified',
},
{
key: 'admin',
label: 'Role',
type: 'boolean',
booleanTrueLabel: 'Admin',
booleanFalseLabel: 'Member',
},

Condition​

condition receives the full entity and returns true to show the field or false to hide it. Evaluated per row.

Admin column only renders for rows where active is true. Mateo (inactive) gets no Admin cell.

Name
Active
Admin (active users only)
Aurora ChenActiveMember
Mateo SilvaInactive
Priya NairActiveAdmin
{
key: 'admin',
label: 'Admin (active users only)',
type: 'boolean',
booleanTrueLabel: 'Admin',
booleanFalseLabel: 'Member',
condition: (entity) => entity.active === true,
},

Field Options Reference​

OptionTypeDefaultEffect
keystringrequiredEntity property to read the value from.
labelstringunsetColumn header or card label.
type'boolean'—Casts value with Boolean() and displays true/false label.
booleanTrueLabelstring'Yes'Text shown when the value is truthy.
booleanFalseLabelstring'No'Text shown when the value is falsy.
formatter(value, entity) => unknownunsetTransform before the boolean cast and label lookup.
condition(entity) => booleanunsetHides the field for rows where the function returns false.
align'left', 'center', 'right''left'Text alignment in table mode.
widthCSS length or numberunsetColumn width in table mode.
showLabeltrue, falsetrue when label is setShows or hides the label in card/grid layouts.
renderAsstringunsetReplace boolean rendering. Use badge for colour-coded status chips.

Caveats​

  • The cast is Boolean(value) — 0, '', null, undefined, and false all render as the false label. 'false' (the string) renders as true because it is a non-empty string.
  • There is no built-in icon or colour on the boolean type itself. Use renderAs: 'badge' with a colorMap for visual status indicators.

See Also​