← All Components
<mth-ai-feedback>
AI response rating control with thumbs up/down, multi-select reason chips (SelectionController), and RTL-aware roving focus.
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-ai-feedback>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ai/ai-feedback"></script>
<mth-ai-feedback rating="up">Example</mth-ai-feedback>import '@methane-ui/ai/ai-feedback';
import '@methane-ui/react';
export function Example() {
return <mth-ai-feedback rating="up">Example</mth-ai-feedback>;
}<script setup lang="ts">
import '@methane-ui/ai/ai-feedback';
</script>
<template>
<mth-ai-feedback rating="up">Example</mth-ai-feedback>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ai/ai-feedback';
import { MthAiFeedbackDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthAiFeedbackDirective],
template: `<mth-ai-feedback rating="up">Example</mth-ai-feedback>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ai/ai-feedback';
import MthAiFeedback from '@methane-ui/svelte/MthAiFeedback.svelte';
</script>
<MthAiFeedback rating="up">Example</MthAiFeedback>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
rating | rating | '' | 'up' | 'down' | "" | Current feedback polarity ('' | 'up' | 'down'). |
reasons | — | string[] | — | Optional custom reason labels overriding localized defaults. |
selectedReasons | — | string[] | — | Currently selected negative-feedback reason identifiers. |
comment | comment | string | "" | Optional free-text user comment. |
submitted | submitted | boolean | false | Marks feedback as submitted and displays confirmation notice. |
disabled | disabled | boolean | false | Disables all feedback interactions. |
label | label | string | "" | Accessible toolbar group label. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-feedback | { rating: '' | 'up' | 'down'; reasons: string[]; comment: string; submitted: boolean } | Fired whenever rating changes or detailed feedback is submitted. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | feedback button focused | moves focus to next control (RTL flipped) |
| ArrowLeft | ltr | feedback button focused | moves focus to previous control (RTL flipped) |
| Home | both | feedback button focused | moves focus to first control |
| End | both | feedback button focused | moves focus to last control |
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 4 APG keyboard transitions across LTR/RTL. | mth-ai-feedback.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(positive), :state(negative), :state(submitted), :state(disabled). | Conformance suite |
| i18n | Routes 10 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |