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

<mth-duration-input>

@methane-ui/ui~9.0 KB brotli (cold + Lit)~2.6 KB marginal

Form-associated segmented hours/minutes/seconds duration input outputting ISO 8601 PT#H#M#S durations.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/duration-input"></script>
<mth-duration-input show-seconds></mth-duration-input>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Duration in ISO 8601 format (e.g. PT1H30M0S) or HH:MM:SS.
namenamestring""Form field name.
labellabelstring""Accessible field label.
showSecondsshow-secondsbooleantrueDisplays the seconds segment.
disableddisabledbooleanfalseDisables interaction.
readonlyreadonlybooleanfalsePrevents changing duration segments.
requiredrequiredbooleanfalseMarks a non-empty duration value as required.

Events

EventDetail TypeDescription
mth-change{ value: string; totalSeconds: number }Fired when any duration segment changes.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowUpbothHours, minutes, or seconds segment is focusedIncrements segment and updates ISO duration value
ArrowDownbothHours, minutes, or seconds segment is focusedDecrements segment and updates ISO duration value

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-duration-input.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(dirty), :state(touched), :state(invalid).Conformance suite
i18nRoutes 4 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test