← All Components
<mth-calendar>
Accessible single-date WAI-ARIA calendar grid powered by CalendarCore and FormattingUtils with Temporal/Date fallback, min/max clamping, disabled dates, and RTL-aware roving grid keyboard navigation.
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-calendar>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/calendar"></script>
<mth-calendar></mth-calendar>import '@methane-ui/ui/calendar';
import '@methane-ui/react';
export function Example() {
return <mth-calendar></mth-calendar>;
}<script setup lang="ts">
import '@methane-ui/ui/calendar';
</script>
<template>
<mth-calendar></mth-calendar>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/calendar';
import { MthCalendarDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthCalendarDirective],
template: `<mth-calendar></mth-calendar>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/calendar';
import MthCalendar from '@methane-ui/svelte/MthCalendar.svelte';
</script>
<MthCalendar></MthCalendar>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Selected date in ISO-8601 YYYY-MM-DD format. |
min | min | string | "" | Minimum selectable date in ISO-8601 YYYY-MM-DD format. |
max | max | string | "" | Maximum selectable date in ISO-8601 YYYY-MM-DD format. |
locale | locale | string | "" | BCP-47 locale override for month, weekday, and first-day-of-week localization. |
disabled | disabled | boolean | false | Disables all calendar navigation and day selection. |
readonly | readonly | boolean | false | Allows grid navigation without changing the selected date. |
isDateDisabled | — | ((iso: string) => boolean) | undefined | — | Optional predicate returning true when a given ISO date should be disabled. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string } | Emitted when a new date is selected. |
mth-focus-date | { value: string } | Emitted when the focused date moves inside the grid. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | both | Day button inside grid is focused | Moves focus one day forward (or backward in RTL) |
| ArrowLeft | both | Day button inside grid is focused | Moves focus one day backward (or forward in RTL) |
| ArrowDown | both | Day button inside grid is focused | Moves focus down one week (+7 days) |
| ArrowUp | both | Day button inside grid is focused | Moves focus up one week (-7 days) |
| Home | both | Day button inside grid is focused | Moves focus to first day of current week |
| End | both | Day button inside grid is focused | Moves focus to last day of current week |
| PageUp | both | Day button inside grid is focused | Moves focus to previous month (or previous year with Shift) |
| PageDown | both | Day button inside grid is focused | Moves focus to next month (or next year with Shift) |
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 8 APG keyboard transitions across LTR/RTL. | mth-calendar.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly). | Conformance suite |
| i18n | Routes 7 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |