Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-chat-thread>

@methane-ui/chat~9.0 KB brotli (kit + Lit)~2.6 KB marginal

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

Interactive StageLive Custom Element · <mth-chat-thread> (@methane-ui/chat)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
messages—ReadonlyArray<unknown>—Inline list of chat messages rendered when no DataSource is active.
dataSource—unknown | nullnullOptional async DataSource<ChatMessage> backing DataController.
estimateHeightestimate-heightnumber72Estimated pixel height per message row for windowing.
overscanoverscannumber4Extra offscreen message count rendered above and below viewport.
unreadMessageIdunread-message-idstring""Message ID before which the unread divider is placed.
labellabelstring""Accessible region label for the conversation log.
showScrollToBottomshow-scroll-to-bottombooleantrueDisplays the scroll-to-bottom button.
allowRawHtmlallow-raw-htmlbooleanfalseOpt-in flag forwarded to @methane-ui/sanitize markdown renderer (defaults to false).

Events

EventDetail TypeDescription
mth-scroll-bottomundefinedFired when user activates the scroll-to-bottom anchor.
mth-retryundefinedFired when user clicks retry on a DataSource error state.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
statesExposes ElementInternals CustomStateSet flags: :state(loading), :state(empty), :state(error).Conformance suite
i18nRoutes 7 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test