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

<mth-countdown>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Live countdown timer using <time datetime> ISO-8601 duration markup, tabular numerals, idempotent timer lifecycle cleanup, and throttled polite live announcements.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/countdown"></script>
<mth-countdown duration="0" running></mth-countdown>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
targettargetstring""Target ISO-8601 timestamp string to count down toward.
durationdurationnumber0Duration in seconds used when target is omitted.
runningrunningbooleantrueStarts or pauses the active countdown interval.
precisionprecision'seconds' | 'minutes'"seconds"Smallest displayed time unit (seconds or minutes).
formatformat'hms' | 'dhms'"dhms"Display segmentation (dhms includes days; hms rolls days into hours).
announceIntervalannounce-intervalnumber30Seconds between polite screen-reader announcements while running (0 announces only completion).

Events

EventDetail TypeDescription
mth-tick{ remainingMs: number; days: number; hours: number; minutes: number; seconds: number }Emitted on each interval tick with remaining duration breakdown.
mth-complete{ target: string }Emitted once when remaining time reaches zero.

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
statesExposes ElementInternals CustomStateSet flags: :state(running), :state(complete).Conformance suite
i18nRoutes 6 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test