bool
The bool
property is used to define a boolean value.
Boolean values default to undefined
when not set in the admin. Use the defaultValue
configuration option to set a default value or set required
to true
to require a value.
import { atom, bool } from '@iridiumcms/core';
export const sample = atom('sample', {
myProp: bool(),
});
Configuration
The bool
field takes an optional configuration object with the following properties:
- defaultValueThe default value of the field. Defaults to
boolean
undefined
. - displayNameThe display name of the field. Defaults to the name of the property.
string
- requiredWhether the field is required. Defaults to
boolean
false
. - layoutThe layout of the field in the admin. Defaults to
LAYOUT
LAYOUT.full
.