← All Components
<mth-date-range-picker>
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
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>import '@methane-ui/ui/date-range-picker';
import '@methane-ui/react';
export function Example() {
return <mth-date-range-picker placeholder="YYYY-MM-DD/YYYY-MM-DD"></mth-date-range-picker>;
}<script setup lang="ts">
import '@methane-ui/ui/date-range-picker';
</script>
<template>
<mth-date-range-picker placeholder="YYYY-MM-DD/YYYY-MM-DD"></mth-date-range-picker>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/date-range-picker';
import { MthDateRangePickerDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthDateRangePickerDirective],
template: `<mth-date-range-picker placeholder="YYYY-MM-DD/YYYY-MM-DD"></mth-date-range-picker>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/date-range-picker';
import MthDateRangePicker from '@methane-ui/svelte/MthDateRangePicker.svelte';
</script>
<MthDateRangePicker placeholder="YYYY-MM-DD/YYYY-MM-DD"></MthDateRangePicker>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
value | value | string | "" | Selected range formatted as YYYY-MM-DD/YYYY-MM-DD. |
startDate | start-date | string | "" | Start date of the selected range in YYYY-MM-DD. |
endDate | end-date | string | "" | End date of the selected range in YYYY-MM-DD. |
name | name | string | "" | Form field name. |
label | label | string | "" | Accessible field label. |
placeholder | placeholder | string | "YYYY-MM-DD/YYYY-MM-DD" | Placeholder text when empty. |
open | open | boolean | false | Whether the range calendar popover is open. |
disabled | disabled | boolean | false | Disables interaction. |
readonly | readonly | boolean | false | Prevents changing the selected range. |
required | required | boolean | false | Marks a date range value as required. |
Events
| Event | Detail Type | Description |
|---|---|---|
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
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowDown | both | Trigger or input is focused | Opens date range calendar popover |
| Escape | both | Calendar 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 2 APG keyboard transitions across LTR/RTL. | mth-date-range-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 |