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

<mth-sidebar-nav>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Collapsible 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.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-sidebar-nav> (@methane-ui/ui)
Methane Docs
Ready · interact with <mth-sidebar-nav>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/sidebar-nav"></script>
<mth-sidebar-nav>Example</mth-sidebar-nav>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Accessible label for the <nav> landmark.
collapsedcollapsedbooleanfalseCollapses the sidebar into compact rail mode.
collapsiblecollapsiblebooleanfalseDisplays a collapse/expand toggle button in the header.
activeValueactive-valuestring""Currently active item value marked with aria-current="page".
activeHrefactive-hrefstring""Currently active item href marked with aria-current="page".
items—ReadonlyArray<unknown>[]Structured array of navigation items with optional group headings.

Events

EventDetail TypeDescription
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

KeyDirectionWhenExpected Behavior
ArrowDownbothfocused on itemmoves focus to next enabled item
ArrowUpbothfocused on itemmoves focus to previous enabled item
Homebothfocused on itemmoves focus to first enabled item
Endbothfocused on itemmoves focus to last enabled item

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 4 APG keyboard transitions across LTR/RTL.mth-sidebar-nav.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(collapsed).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test