← All Components
<mth-thinking-indicator>
Collapsible AI reasoning/chain-of-thought disclosure with elapsed timing and MotionController reduced-motion support.
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-thinking-indicator>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ai/thinking-indicator"></script>
<mth-thinking-indicator elapsed-seconds="0">Example</mth-thinking-indicator>import '@methane-ui/ai/thinking-indicator';
import '@methane-ui/react';
export function Example() {
return <mth-thinking-indicator elapsed-seconds="0">Example</mth-thinking-indicator>;
}<script setup lang="ts">
import '@methane-ui/ai/thinking-indicator';
</script>
<template>
<mth-thinking-indicator elapsed-seconds="0">Example</mth-thinking-indicator>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ai/thinking-indicator';
import { MthThinkingIndicatorDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthThinkingIndicatorDirective],
template: `<mth-thinking-indicator elapsed-seconds="0">Example</mth-thinking-indicator>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ai/thinking-indicator';
import MthThinkingIndicator from '@methane-ui/svelte/MthThinkingIndicator.svelte';
</script>
<MthThinkingIndicator elapsed-seconds="0">Example</MthThinkingIndicator>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Controls whether the reasoning panel is expanded. |
streaming | streaming | boolean | false | Displays active thinking spinner while reasoning streams. |
elapsedSeconds | elapsed-seconds | number | 0 | Formatted reasoning duration in seconds. |
summary | summary | string | "" | Custom disclosure heading overriding default localized label. |
content | content | string | "" | Plain-text reasoning summary shown inside the disclosure panel. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-toggle | { open: boolean } | Fired when the user toggles the disclosure state. |
mth-open | void | Cancelable motion lifecycle event before expanding. |
mth-after-open | void | Fired after expansion completes. |
mth-close | void | Cancelable motion lifecycle event before collapsing. |
mth-after-close | void | Fired after collapse completes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | trigger button focused | toggles reasoning panel open/closed |
| Space | both | trigger button focused | toggles reasoning panel open/closed |
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 |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-thinking-indicator.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(streaming). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |