Aphex
Schema Types

Boolean

True/false toggle for binary choices.

The boolean type renders a checkbox. Use it for on/off flags like published state, visibility toggles, or feature flags.

Definition

import type { BooleanField } from '@aphexcms/cms-core';
{
  name: 'published',
  type: 'boolean',
  title: 'Published',
  description: 'Make this document publicly visible.',
  initialValue: false
}

Properties

PropertyTypeRequiredDescription
namestringYesField identifier.
type'boolean'YesMust be 'boolean'.
titlestringYesLabel shown next to the checkbox.
descriptionstringNoHelp text shown below the label.
initialValueboolean | () => boolean | Promise<boolean>NoDefault value.
validation(Rule) => RuleNoValidation rules.

Examples

Feature flag

{
  name: 'featured',
  type: 'boolean',
  title: 'Featured',
  description: 'Show this item in the featured section.',
  initialValue: false
}

Required acknowledgment

{
  name: 'confirmed',
  type: 'boolean',
  title: 'Confirmed',
  validation: (Rule) => Rule.required()
}

Validation

Available rules: required(), custom(fn), error(msg), warning(msg), info(msg)

Edit on GitHub

Last updated on