Skip to content

Boolean

Trigger: schema type: "boolean".
Default component: UCheckbox. With toggle: USwitch.

API

NameTypeDefaultDescription
toggleBooleanWhen true, renders a USwitch instead of the UCheckbox.
checkboxObjectPass-through → UCheckbox (ignored when toggle is set).
switchObjectPass-through → USwitch (when toggle is set).

Examples

Checkbox

json
{
  "type": "boolean",
  "title": "I accept the terms"
}
json
{
  "type": "Control",
  "scope": "#/properties/terms",
  "options": {
    "checkbox": { "color": "primary" }
  }
}

Switch

json
{
  "type": "Control",
  "scope": "#/properties/notifications",
  "options": {
    "toggle": true,
    "switch": { "size": "lg", "color": "success" }
  }
}

Playground

Boolean

Released under the BSD-3-Clause License.