Interfacestable
Clock
Date and time display
A compact live or static date and time, formatted with Intl in any locale and time zone.
Customize
DisplayIntl formatting, no date library
variantshowsecondstimeZoneUsage
import { Clock } from "zerogravity/clock"
<Clock />Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
variant | "pixel" | "classic" | "glass" | "pixel" | Style. |
show | "datetime" | "date" | "time" | "datetime" | Show. |
seconds | boolean | false | Seconds. |
value | Date | live | A fixed instant instead of the live time. |
timeZone | string | device | Any IANA zone. |
locale | string | device | Any BCP 47 locale. |
hour12 | boolean | locale | Force a 12 or 24 hour clock. |
dateFormat | Intl.DateTimeFormatOptions | { weekday: short, day: numeric, month: short } | Date part options. |
separator | ReactNode | "·" | Between date and time. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.