<baht-comments>
A record conversation: the thread, oldest first, and a composer. With allow-internal the composer can post an internal note (shown marked; the host keeps it from the requester). Submitting emits baht-submit with { body, internal } and clears the box.
Basic
Events (baht-submit, name)
<baht-comments allow-internal="true"></baht-comments>
<script>
const el = document.querySelector('baht-comments');
el.entries = [
{
"id": 1,
"author": "Bob",
"time": "14:44",
"body": "Printer still jammed"
},
{
"id": 2,
"author": "Alice",
"time": "14:50",
"body": "Swapped the toner",
"internal": true
}
];
</script>| Name | Type | Default | Description |
|---|---|---|---|
entriesJS | CommentEntry[] | [] | { id, author, time?, body, internal? } |
allow-internal | boolean | false | |
placeholder | string | 'Add a comment…' | Composer placeholder |
internal-label | string | 'Internal note' | |
empty-message | string | 'No comments yet.' | |
busy | boolean | false | Disables posting |
allowInternal | boolean | false | Offer internal notes in the composer |
internalLabel | string | 'Internal note' | Name of an internal note |