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

<mth-ai-feedback>

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

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

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

Properties & Attributes

PropertyAttributeTypeDefaultDescription
ratingrating'' | 'up' | 'down'""Current feedback polarity ('' | 'up' | 'down').
reasons—string[]—Optional custom reason labels overriding localized defaults.
selectedReasons—string[]—Currently selected negative-feedback reason identifiers.
commentcommentstring""Optional free-text user comment.
submittedsubmittedbooleanfalseMarks feedback as submitted and displays confirmation notice.
disableddisabledbooleanfalseDisables all feedback interactions.
labellabelstring""Accessible toolbar group label.

Events

EventDetail TypeDescription
mth-feedback{ rating: '' | 'up' | 'down'; reasons: string[]; comment: string; submitted: boolean }Fired whenever rating changes or detailed feedback is submitted.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrfeedback button focusedmoves focus to next control (RTL flipped)
ArrowLeftltrfeedback button focusedmoves focus to previous control (RTL flipped)
Homebothfeedback button focusedmoves focus to first control
Endbothfeedback button focusedmoves focus to last control

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
keyboardImplements all 4 APG keyboard transitions across LTR/RTL.mth-ai-feedback.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(positive), :state(negative), :state(submitted), :state(disabled).Conformance suite
i18nRoutes 10 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test