GitHubGitHub
← All widgets
Utility / widget

Clock widget

A timezone-aware clock with 12/24-hour modes, optional seconds, a smooth progress rail, and a live configuration editor.

24 hour12 hourSecondsReduced motionEditor
Local time: 13:06, Tuesday 18 Aug 2026
Tuesday·18 Aug 2026
◎ Europe/MadridGMT+2
<ClockWidget timezone="Europe/Madrid" showSeconds />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { ClockWidget } from '@chanrg/4ui';<ClockWidget timezone="Europe/Madrid" showSeconds />

API reference

Props

PropTypeDefaultDescription
timezonestring | nullbrowser zonePinned IANA timezone.
hourCycleh12 | h23h23Hour format.
showSecondsbooleantrueSeconds display.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Announces time at minute granularity rather than every animation frame.

Dependencies

Intl.DateTimeFormat