← All Components
<mth-comment-thread>
Nested discussion comment thread with collapse/expand replies, resolve/reopen actions, inline replies, and @methane-ui/sanitize markdown bodies.
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-comment-thread>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/chat/comment-thread"></script>
<mth-comment-thread allow-reply allow-resolve></mth-comment-thread>import '@methane-ui/chat/comment-thread';
import '@methane-ui/react';
export function Example() {
return <mth-comment-thread allow-reply allow-resolve></mth-comment-thread>;
}<script setup lang="ts">
import '@methane-ui/chat/comment-thread';
</script>
<template>
<mth-comment-thread allow-reply allow-resolve></mth-comment-thread>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/chat/comment-thread';
import { MthCommentThreadDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthCommentThreadDirective],
template: `<mth-comment-thread allow-reply allow-resolve></mth-comment-thread>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/chat/comment-thread';
import MthCommentThread from '@methane-ui/svelte/MthCommentThread.svelte';
</script>
<MthCommentThread allow-reply allow-resolve></MthCommentThread>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
comments | — | ReadonlyArray<unknown> | — | Top-level comments with optional recursive replies arrays. |
label | label | string | "" | Accessible region label. |
allowReply | allow-reply | boolean | true | Enables inline reply triggers and forms. |
allowResolve | allow-resolve | boolean | true | Enables resolve/reopen controls on top-level threads. |
allowRawHtml | allow-raw-html | boolean | false | Opt-in flag forwarded to @methane-ui/sanitize (defaults to false). |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-reply | { parentId: string; body: string } | Fired when an inline reply is submitted. |
mth-resolve-toggle | { id: string; resolved: boolean } | Fired when resolve/reopen state is toggled. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | 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(empty). | Conformance suite |
| i18n | Routes 11 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |