Skip to content
bahtuiv0.6.0

<baht-currency>

Money input: plain digits while typing, thousands-separated on blur. Emits a plain number | null, same wire shape as <baht-number> (spec 01 §2).

Basic

<baht-currency></baht-currency>

<script>
  const el = document.querySelector('baht-currency');
  el.field = {
    "order": 1,
    "type": "currency",
    "key": "amount",
    "label": "Amount",
    "placeholder": "0.00"
  };
  el.value = 13720.5;
</script>
NameTypeDefaultDescription
fieldJSFieldDescriptorField spec: { order, type: 'currency', key, label?, placeholder?, … }
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 | undefined150 (BahtFieldBase.defaultDebounce)Quiet time (ms) before typing reaches the host as baht-input. Blur flushes at once. 0 = every keystroke. <baht-form options.inputDebounce> sets it form-wide
EventdetailDescription
nameCustomEvent
baht-input{ key, value }Fired on every user edit — value is number | null, commas stripped