Skip to content
bahtuiv0.6.0

<baht-select>

Single-choice dropdown from field.options. Renders its own listbox (light DOM, tokens) instead of the native <select> — identical on iOS/macOS, no OS picker. APG select-only combobox: arrows, Home/End, Enter/Space, Escape, type-to-select.

Basic

<baht-select></baht-select>

<script>
  const el = document.querySelector('baht-select');
  el.field = {
    "order": 1,
    "type": "dropdown",
    "key": "plan",
    "label": "Plan",
    "placeholder": "Choose a plan",
    "options": [
      {
        "key": "free",
        "label": "Free"
      },
      {
        "key": "pro",
        "label": "Pro, ฿20/mo"
      },
      {
        "key": "team",
        "label": "Team"
      }
    ]
  };
  el.value = null;
</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