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

<mth-time-picker>

@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginal

Form-associated time picker with 12h/24h formatting, configurable minute steps, and floating option list.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/time-picker"></script>
<mth-time-picker placeholder="HH:MM" step-minutes="30"></mth-time-picker>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Selected time string in HH:MM 24-hour format.
namenamestring""Form control field name.
labellabelstring""Accessible field label.
placeholderplaceholderstring"HH:MM"Placeholder shown when empty.
stepMinutesstep-minutesnumber30Interval between generated time options in minutes.
use12Houruse-12-hourbooleanfalseFormats time options in localized 12-hour AM/PM style.
openopenbooleanfalseWhether the time options popover is open.
disableddisabledbooleanfalseDisables interaction and submission.
readonlyreadonlybooleanfalsePrevents changing the selected time.
requiredrequiredbooleanfalseMarks a time selection as required.

Events

EventDetail TypeDescription
mth-change{ value: string }Fired when the selected time changes.
mth-open{ open: true }Cancelable event fired before opening the popover.
mth-after-open{ open: true }Fired after opening completes.
mth-close{ reason: string }Fired when the popover closes.
mth-after-close{ reason: string }Fired after closing and focus restore complete.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothTrigger or input is focusedOpens time options popover
EscapebothTime 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-time-picker.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(disabled), :state(readonly), :state(dirty), :state(touched), :state(invalid).Conformance suite
i18nRoutes 2 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test