Switch

Switch

Form Field

The switch field renders a switch box. Similar to a checkbox field except displayed as a toggle switch.

show_content:
    label: Display Content
    type: switch

The following field properties are supported and commonly used.

Property Description
label a name when displaying the form field to the user.
default a default value to use for new records.
comment text to display below the checkbox.

You may use the default property to enable the switch by default.

show_content:
    label: Display Content
    type: switch
    default: true

Use the comment to display some accompanying text.

show_content:
    label: Display Content
    type: switch
    comment: Flick this switch to display content

# See Also

On This Page