Skip to content

Enumérations


Select menu (défaut) — USelectMenu

Activation : schema enum ou oneOf const/title, sans format spécial.

API

NameTypeDefaultDescription
suggestionArraySuggestions libres (également utilisable hors enum strict).
placeholderStringPlaceholder.
selectMenuObjectPass-through → USelectMenu (recherche, taille, …).

Exemple

json
{
  "type": "string",
  "title": "Pays",
  "enum": ["FR", "BE", "CH"]
}
json
{
  "type": "Control",
  "scope": "#/properties/country",
  "options": {
    "placeholder": "Choisir…",
    "selectMenu": { "size": "md" }
  }
}

Select (sans recherche) — USelect

Activation : options.format: "select".

API

NameTypeDefaultDescription
format"select"Requis.
selectObjectPass-through → USelect.

Exemple

json
{
  "type": "Control",
  "scope": "#/properties/tier",
  "options": {
    "format": "select",
    "placeholder": "Formule",
    "select": { "size": "sm" }
  }
}

Radio — URadioGroup

Activation : options.format: "radio".

API

NameTypeDefaultDescription
format"radio"Requis.
verticalBooleantrue (effectif)false → orientation horizontale.
orientation"horizontal" | "vertical"Prioritaire sur vertical si défini.
radioGroupObjectPass-through → URadioGroup (variant, size, color, orientation, …).

Priorité d’orientation : radioGroup.orientation > orientation > vertical: false > vertical.

Exemples

json
{
  "type": "Control",
  "scope": "#/properties/size",
  "options": {
    "format": "radio",
    "vertical": false
  }
}
json
{
  "type": "Control",
  "scope": "#/properties/plan",
  "options": {
    "format": "radio",
    "orientation": "horizontal",
    "radioGroup": {
      "variant": "list",
      "size": "md",
      "color": "primary"
    }
  }
}

Multi-enum — UCheckboxGroup

Activation : schema type: "array" avec items.enum ou items.oneOf.

API

NameTypeDefaultDescription
verticalBooleanfalse → disposition horizontale.
checkboxGroupObjectPass-through → UCheckboxGroup.

Exemple

json
{
  "type": "array",
  "title": "Compétences",
  "uniqueItems": true,
  "items": {
    "type": "string",
    "enum": ["vue", "typescript", "css"]
  }
}
json
{
  "type": "Control",
  "scope": "#/properties/skills",
  "options": {
    "vertical": false,
    "checkboxGroup": { "size": "sm" }
  }
}

Playground

Publié sous licence BSD-3-Clause.