← All Components
<mth-facet-filters>
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
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>import '@methane-ui/commerce/facet-filters';
import '@methane-ui/react';
export function Example() {
return <mth-facet-filters collapsible></mth-facet-filters>;
}<script setup lang="ts">
import '@methane-ui/commerce/facet-filters';
</script>
<template>
<mth-facet-filters collapsible></mth-facet-filters>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/commerce/facet-filters';
import { MthFacetFiltersDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthFacetFiltersDirective],
template: `<mth-facet-filters collapsible></mth-facet-filters>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/commerce/facet-filters';
import MthFacetFilters from '@methane-ui/svelte/MthFacetFilters.svelte';
</script>
<MthFacetFilters collapsible></MthFacetFilters>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
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. |
collapsible | collapsible | boolean | true | Allows facet groups to toggle expanded/collapsed state. |
label | label | string | "" | Accessible region label overriding localized default. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-filter-change | { groupId: string; selected: Record<string, ReadonlyArray<string>>; ranges: Record<string, unknown> } | Emitted event mth-filter-change. |
mth-filter-clear | Record<string, never> | Emitted event mth-filter-clear. |
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(has-active-filters). | Conformance suite |
| i18n | Routes 5 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |