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

<mth-date-range-calendar>

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

Multi-month accessible date-range picker calendar powered by CalendarCore (mode: "range") and FormattingUtils with logical range-highlight styling, live hover/focus preview, and RTL-aware 2D grid 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

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/date-range-calendar"></script>
<mth-date-range-calendar months="2"></mth-date-range-calendar>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
startstartstring""Selected range start date in ISO-8601 YYYY-MM-DD format.
endendstring""Selected range end date in ISO-8601 YYYY-MM-DD format.
minminstring""Minimum selectable date in ISO-8601 YYYY-MM-DD format.
maxmaxstring""Maximum selectable date in ISO-8601 YYYY-MM-DD format.
monthsmonthsnumber2Number of side-by-side months to display (1 or 2).
localelocalestring""BCP-47 locale override for month names, weekdays, and first day of week.
disableddisabledbooleanfalseDisables calendar interaction.
readonlyreadonlybooleanfalseAllows grid focus navigation without modifying the range.
isDateDisabled—((iso: string) => boolean) | undefined—Optional predicate returning true for disabled ISO dates.

Events

EventDetail TypeDescription
mth-change{ start: string; end: string }Emitted when the range selection is updated with { start, end }.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightbothDay button inside range grid is focusedMoves focus one day forward (or backward in RTL)
ArrowLeftbothDay button inside range grid is focusedMoves focus one day backward (or forward in RTL)
ArrowDownbothDay button inside range grid is focusedMoves focus down one week (+7 days)
ArrowUpbothDay button inside range grid is focusedMoves focus up one week (-7 days)

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-date-range-calendar.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly).Conformance suite
i18nRoutes 5 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test