Toggle

The Toggle Field is a boolean toggle. You can set its value for content that needs a true and or false state.

Toggle Field
{
  component: 'toggle',
  name: 'toggleName',
  label: 'Toggle Field',
  description: 'A toggle field',
  toggleLabels: {
    true: 'Enable',
    false: 'Disable',
  },
  defaultValue: true,
}

Key

Type

Required

Description

component

string

yes

The name of the field component. (toggle)

name

string

yes

The name of the field that will be accessible by the cms prop of the component.

label

string

no

A human-readable label for the field.

description

string

no

A short description of the setting scope.

toggleLabels

string

no

An object that you use to label your true and false values. { true: string, false: string }

defaultValue

boolean

no

This will be either true or false.

Last updated