Skip to content
bahtuiv0.18.8

<baht-markdown>

Markdown field: Write and Preview tabs, with files pasted, dropped or picked in as links. Apps need the marked and dompurify peers.

Basic

<baht-markdown></baht-markdown>

<script>
  const el = document.querySelector('baht-markdown');
  el.field = {
    "order": 1,
    "type": "markdown",
    "key": "notes",
    "label": "Notes",
    "rows": 4
  };
  el.value = "## Root cause\n\nThe disk was **full**.";
</script>
NameTypeDefaultDescription
uploaderJS(file: File) => Promise<UploadedFile> | undefined—Resolved registry uploader. <baht-form> injects it when field.uploader is set
allowImageJSMarkdownImagePolicy | undefined—Which image URLs may embed; any other image renders as a link. <baht-form> injects registry.markdownImage
fieldJSFieldDescriptor—Field 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 | 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
baht-input{ key, value }Fired on every user edit
nameCustomEvent