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

<mth-date-range-picker>

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

Form-associated ISO date range picker powered by CalendarCore({ mode: "range" }) and FormattingUtils.formatDateRange.

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

Multi-Framework Playground & Snippets

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

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Selected range formatted as YYYY-MM-DD/YYYY-MM-DD.
startDatestart-datestring""Start date of the selected range in YYYY-MM-DD.
endDateend-datestring""End date of the selected range in YYYY-MM-DD.
namenamestring""Form field name.
labellabelstring""Accessible field label.
placeholderplaceholderstring"YYYY-MM-DD/YYYY-MM-DD"Placeholder text when empty.
openopenbooleanfalseWhether the range calendar popover is open.
disableddisabledbooleanfalseDisables interaction.
readonlyreadonlybooleanfalsePrevents changing the selected range.
requiredrequiredbooleanfalseMarks a date range value as required.

Events

EventDetail TypeDescription
mth-change{ value: string; startDate: string; endDate: string }Fired when a date range is completed or updated.
mth-open{ open: true }Cancelable event fired before opening.
mth-after-open{ open: true }Fired after opening completes.
mth-close{ reason: string }Fired on close.
mth-after-close{ reason: string }Fired after close completes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothTrigger or input is focusedOpens date range calendar popover
EscapebothCalendar 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 2 APG keyboard transitions across LTR/RTL.mth-date-range-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