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

<mth-clock>

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

Localized digital and analog <time> clock component powered by FormattingUtils with optional time-zone, fixed SSR-safe value snapshot, and automatic interval teardown.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/clock"></script>
<mth-clock variant="digital" show-seconds></mth-clock>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
valuevaluestring""Optional fixed ISO-8601 timestamp or HH:MM[:SS] value (disables live clock ticking).
timeZonetime-zonestring""Optional IANA time zone (e.g. UTC, America/New_York).
localelocalestring""BCP-47 locale override for localized digital time formatting.
variantvariant'digital' | 'analog' | 'both'"both"Presentation mode (digital, analog, or both).
hour12hour-12booleanfalseUses 12-hour cycle when true (false uses locale/24-hour formatting).
showSecondsshow-secondsbooleantrueDisplays seconds in digital readout and analog second hand.
livelivebooleantrueAutomatically updates once per second when connected and no value is set.

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(live).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test