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

<mth-facet-filters>

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

Collapsible faceted product filter sidebar supporting checkbox lists, CSP-safe adopted-stylesheet color swatches, and numeric range bounds.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/commerce/facet-filters"></script>
<mth-facet-filters collapsible></mth-facet-filters>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
facets—ReadonlyArray<unknown>—Array of FacetGroup definitions (checkbox, swatch, or range).
selected—Record<string, ReadonlyArray<string>>—Map of facet group ID to selected option values.
ranges—Record<string, unknown>—Map of range facet group ID to min/max bounds.
collapsiblecollapsiblebooleantrueAllows facet groups to toggle expanded/collapsed state.
labellabelstring""Accessible region label overriding localized default.

Events

EventDetail TypeDescription
mth-filter-change{ groupId: string; selected: Record<string, ReadonlyArray<string>>; ranges: Record<string, unknown> }Emitted event mth-filter-change.
mth-filter-clearRecord<string, never>Emitted event mth-filter-clear.

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
statesExposes ElementInternals CustomStateSet flags: :state(has-active-filters).Conformance suite
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test