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

<mth-comparison-table>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Accessible feature and plan comparison matrix with semantic <th scope="col"> and <th scope="row"> headers, boolean inclusion indicators, and sticky headers.

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-comparison-table> (@methane-ui/ui)
Ready · interact with <mth-comparison-table>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/comparison-table"></script>
<mth-comparison-table></mth-comparison-table>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
captioncaptionstring""Visible <caption> text describing the comparison matrix.
labellabelstring""Accessible region and table label when no visible caption is set.
plans—unknown[]—Array of plan columns ({ id, name, price?, badge?, highlighted?, actionLabel? }).
rows—unknown[]—Array of feature rows ({ id?, feature, description?, values }).
stickyHeadersticky-headerbooleanfalsePins column headers at the block start while scrolling.
compactcompactbooleanfalseApplies denser vertical cell padding.

Events

EventDetail TypeDescription
mth-select-plan{ id: string; name: string }Emitted when a plan header action button is activated.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowLeft / ArrowRightbothHorizontal scroll wrapper is focusedScrolls overflowing comparison matrix horizontally

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-comparison-table.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(sticky-header), :state(compact).Conformance suite
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test