← All Components
<mth-month-picker>
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
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>import '@methane-ui/ui/month-picker';
import '@methane-ui/react';
export function Example() {
return <mth-month-picker placeholder="YYYY-MM"></mth-month-picker>;
}<script setup lang="ts">
import '@methane-ui/ui/month-picker';
</script>
<template>
<mth-month-picker placeholder="YYYY-MM"></mth-month-picker>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/month-picker';
import { MthMonthPickerDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthMonthPickerDirective],
template: `<mth-month-picker placeholder="YYYY-MM"></mth-month-picker>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/month-picker';
import MthMonthPicker from '@methane-ui/svelte/MthMonthPicker.svelte';
</script>
<MthMonthPicker placeholder="YYYY-MM"></MthMonthPicker>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Selected month in YYYY-MM format. |
name | name | string | "" | Form field name. |
label | label | string | "" | Accessible field label. |
placeholder | placeholder | string | "YYYY-MM" | Placeholder shown when empty. |
open | open | boolean | false | Whether the month grid popover is open. |
disabled | disabled | boolean | false | Disables interaction. |
readonly | readonly | boolean | false | Prevents changing the selected month. |
required | required | boolean | false | Marks a month selection as required. |
Events
| Event | Detail Type | Description |
|---|---|---|
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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | both | Month cell is focused | Moves focus to next month (RTL-aware) |
| ArrowLeft | both | Month cell is focused | Moves focus to previous month (RTL-aware) |
| ArrowDown | both | Month cell is focused | Moves focus three months forward |
| ArrowUp | both | Month cell is focused | Moves focus three months backward |
| Escape | both | Month popover is open | Closes popover and restores focus |
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 5 APG keyboard transitions across LTR/RTL. | mth-month-picker.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(disabled), :state(readonly), :state(dirty), :state(touched), :state(invalid). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |