← All Components
<mth-chat-thread>
Virtualized chat message stream with VirtualizerController, DataController support, date/unread dividers, sanitized markdown bodies, and scroll-to-bottom anchor.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-chat-thread>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/chat/chat-thread"></script>
<mth-chat-thread estimate-height="72" overscan="4"></mth-chat-thread>import '@methane-ui/chat/chat-thread';
import '@methane-ui/react';
export function Example() {
return <mth-chat-thread estimate-height="72" overscan="4"></mth-chat-thread>;
}<script setup lang="ts">
import '@methane-ui/chat/chat-thread';
</script>
<template>
<mth-chat-thread estimate-height="72" overscan="4"></mth-chat-thread>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/chat/chat-thread';
import { MthChatThreadDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthChatThreadDirective],
template: `<mth-chat-thread estimate-height="72" overscan="4"></mth-chat-thread>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/chat/chat-thread';
import MthChatThread from '@methane-ui/svelte/MthChatThread.svelte';
</script>
<MthChatThread estimate-height="72" overscan="4"></MthChatThread>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
messages | — | ReadonlyArray<unknown> | — | Inline list of chat messages rendered when no DataSource is active. |
dataSource | — | unknown | null | null | Optional async DataSource<ChatMessage> backing DataController. |
estimateHeight | estimate-height | number | 72 | Estimated pixel height per message row for windowing. |
overscan | overscan | number | 4 | Extra offscreen message count rendered above and below viewport. |
unreadMessageId | unread-message-id | string | "" | Message ID before which the unread divider is placed. |
label | label | string | "" | Accessible region label for the conversation log. |
showScrollToBottom | show-scroll-to-bottom | boolean | true | Displays the scroll-to-bottom button. |
allowRawHtml | allow-raw-html | boolean | false | Opt-in flag forwarded to @methane-ui/sanitize markdown renderer (defaults to false). |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-scroll-bottom | undefined | Fired when user activates the scroll-to-bottom anchor. |
mth-retry | undefined | Fired when user clicks retry on a DataSource error state. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| states | Exposes ElementInternals CustomStateSet flags: :state(loading), :state(empty), :state(error). | Conformance suite |
| i18n | Routes 7 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |