Skip to content

toggle

Custom field type

All field types

An on-or-off choice rendered as a switch, with labels and colours you choose.

Written as
"Type": "toggle"
Valid on
Template fields, Datastore schema, and custom site settings
Stores
{{ toggle }} — the Liquid object a template reads from this field.
Validators
This type carries no validators.
Default value
The configured OnValue or OffValue, or true and false when you set neither.

Properties

Accepted in addition to the shared properties every definition carries.

Property Required Description
OnLabel Text beside the switch when it is on.
OnValue Value stored when it is on.
OnColor Colour of the switch when it is on.
OffLabel Text beside the switch when it is off.
OffValue Value stored when it is off.
OffColor Colour of the switch when it is off.