Skip to content
bahtuiv0.6.0

<baht-multiselect>

Checkbox group; value is string[] in field.options order.

Basic

<baht-multiselect></baht-multiselect>

<script>
  const el = document.querySelector('baht-multiselect');
  el.field = {
    "order": 1,
    "type": "multiselect",
    "key": "toppings",
    "label": "Toppings",
    "options": [
      {
        "key": "cheese",
        "label": "Cheese"
      },
      {
        "key": "bacon",
        "label": "Bacon"
      },
      {
        "key": "mushroom",
        "label": "Mushroom"
      }
    ]
  };
  el.value = [
    "cheese"
  ];
</script>
NameTypeDefaultDescription
fieldJSFieldDescriptorField spec: { order, type, key, label?, placeholder?, options?, … }
valueJSunknownnullControlled value. Re-feed on every baht-input
disabledbooleanfalseDisable the control
readonlybooleanfalseRead-only
requiredbooleanfalseShow required mark
show-optionalbooleanfalseAppend the localized "(optional)" marker to the label when not required (set by <baht-form show-optional>).
errorJSstring | nullnullValidation message to display
debouncenumber | undefinedDebounce for typed edits (ms); unset = BahtFieldBase.defaultDebounce.
EventdetailDescription
nameCustomEvent
baht-input{ key, value }Fired on every user edit