@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginalCollapsible vertical navigation landmark with roving focus keyboard navigation, grouped items, and safe href validation.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Multi-Framework Playground & Snippets
Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|
label | label | string | "" | Accessible label for the <nav> landmark. |
collapsed | collapsed | boolean | false | Collapses the sidebar into compact rail mode. |
collapsible | collapsible | boolean | false | Displays a collapse/expand toggle button in the header. |
activeValue | active-value | string | "" | Currently active item value marked with aria-current="page". |
activeHref | active-href | string | "" | Currently active item href marked with aria-current="page". |
items | — | ReadonlyArray<unknown> | [] | Structured array of navigation items with optional group headings. |
Events
| Event | Detail Type | Description |
|---|
mth-select | { value: string; href?: string; label: string } | Fired when a navigation item is activated. |
mth-collapse-change | { collapsed: boolean } | Fired when the collapsed state toggles. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|
| ArrowDown | both | focused on item | moves focus to next enabled item |
| ArrowUp | both | focused on item | moves focus to previous enabled item |
| Home | both | focused on item | moves focus to first enabled item |
| End | both | focused on item | moves focus to last enabled item |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 4 APG keyboard transitions across LTR/RTL. | mth-sidebar-nav.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(collapsed). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |