Skip to content

Booléen

Activation : schema type: "boolean".
Composant par défaut : UCheckbox. Avec toggle : USwitch.

API

NameTypeDefaultDescription
toggleBooleanSi true, rend un USwitch à la place du UCheckbox.
checkboxObjectPass-through → UCheckbox (ignoré si toggle).
switchObjectPass-through → USwitch (si toggle).

Exemples

Case à cocher

json
{
  "type": "boolean",
  "title": "J’accepte les conditions"
}
json
{
  "type": "Control",
  "scope": "#/properties/terms",
  "options": {
    "checkbox": { "color": "primary" }
  }
}

Interrupteur

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

Playground

Boolean

Publié sous licence BSD-3-Clause.