← All Components
<mth-review-summary>
Aggregate rating summary with 5-to-1 distribution bars rendered via adopted CSSStyleSheet and interactive star-filter toggles.
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-review-summary>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/commerce/review-summary"></script>
<mth-review-summary average="0" total-reviews="0"></mth-review-summary>import '@methane-ui/commerce/review-summary';
import '@methane-ui/react';
export function Example() {
return <mth-review-summary average="0" total-reviews="0"></mth-review-summary>;
}<script setup lang="ts">
import '@methane-ui/commerce/review-summary';
</script>
<template>
<mth-review-summary average="0" total-reviews="0"></mth-review-summary>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/commerce/review-summary';
import { MthReviewSummaryDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthReviewSummaryDirective],
template: `<mth-review-summary average="0" total-reviews="0"></mth-review-summary>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/commerce/review-summary';
import MthReviewSummary from '@methane-ui/svelte/MthReviewSummary.svelte';
</script>
<MthReviewSummary average="0" total-reviews="0"></MthReviewSummary>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
average | average | number | 0 | Average rating value. |
totalReviews | total-reviews | number | 0 | Total number of reviews. |
breakdown | — | Record<number, number> | — | Map from star rating (1..5) to review count. |
activeStar | active-star | number | null | null | Currently active star filter, or null when unfiltered. |
maxStars | max-stars | number | 5 | Maximum rating scale (default 5). |
label | label | string | "" | Accessible region label overriding localized default. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-rating-filter | { star: number | null } | Emitted event mth-rating-filter. |
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 |
| states | Exposes ElementInternals CustomStateSet flags: :state(filtered), :state(empty). | Conformance suite |
| i18n | Routes 6 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |