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

<mth-month-picker>

@methane-ui/ui~11.2 KB brotli (cold + Lit)~3.8 KB marginal

Form-associated YYYY-MM month picker with year stepper and 3x4 roving-focus month grid.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/month-picker"></script>
<mth-month-picker placeholder="YYYY-MM"></mth-month-picker>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Selected month in YYYY-MM format.
namenamestring""Form field name.
labellabelstring""Accessible field label.
placeholderplaceholderstring"YYYY-MM"Placeholder shown when empty.
openopenbooleanfalseWhether the month grid popover is open.
disableddisabledbooleanfalseDisables interaction.
readonlyreadonlybooleanfalsePrevents changing the selected month.
requiredrequiredbooleanfalseMarks a month selection as required.

Events

EventDetail TypeDescription
mth-change{ value: string }Fired when the selected month changes.
mth-open{ open: true }Cancelable event fired before opening.
mth-after-open{ open: true }Fired after opening.
mth-close{ reason: string }Fired on close.
mth-after-close{ reason: string }Fired after close completes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightbothMonth cell is focusedMoves focus to next month (RTL-aware)
ArrowLeftbothMonth cell is focusedMoves focus to previous month (RTL-aware)
ArrowDownbothMonth cell is focusedMoves focus three months forward
ArrowUpbothMonth cell is focusedMoves focus three months backward
EscapebothMonth popover is openCloses popover and restores focus

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 5 APG keyboard transitions across LTR/RTL.mth-month-picker.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(disabled), :state(readonly), :state(dirty), :state(touched), :state(invalid).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test