Switcher

For situations where you want to allow users just to enable or disable some options, you can consider the switcher field, which allows only two values - true or false:

{
    "name": "lazyLoad",
    "label": "Lazyload",
    "group": "Additional",
    "note": "Enables lazyloading images that are currently not viewed, thus saving bandwidth.",
    "value": true,
    "type": "checkbox"
}
Switcher HTML

The switcher fields are great for handling the conditional displays of other options with the use of the dependencies parameter described under Theme Settings API.

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide