Import Clock and compose its parts.
clock.tsx
Clock
<time>| Prop | Type | Default | Description |
|---|---|---|---|
| time | string | — | The IANA zone ("Asia/Tokyo"). Default: the runtime zone. Summer time comes from the zone. |
| hour | 1224 | — | 12 ("2:32 PM") or 24 ("14:32"), as the other time components take it. Default: the locale's cycle. |
| show | boolean | false | Show the seconds. false (default) wakes on each minute; true wakes each second. |
| time | "long""longGeneric""longOffset""short""shortGeneric""shortOffset" | — | A zone label after the time, in muted text (data-slot="clock-zone"): short ("CEST" in en-GB, "GMT+2" in en-US), shortOffset ("GMT+2"), long ("Central European Summer Time"). Default: no label. |
| date | — | A date part before the time, in muted text (data-slot="clock-date"): short-weekday ("Wed, Nov 4 14:32"), or an Intl style (short, medium, long, full). The date is the day in timeZone. Default: no date part. | |
| show | boolean | false | When timeZone is on another day than the reader: "tomorrow" or "yesterday" after the time, in muted text (data-slot="clock-day"), from Intl.RelativeTimeFormat. It shows after hydration only (the server does not know the reader's zone), and not with dateStyle. Default false: a world clock row often puts the day in a lane of its own. |
| locale | string | — | The BCP 47 language tag. Default: the DisplayLocaleProvider locale, else "en-US". |
| now | number | Date | — | A fixed now for tests and stories. With it, no timer runs. |
| tooltip | boolean | true | Show the full date and the long zone name in a Tooltip on hover. Default true. |
| ...props | <time> attributes | — | Every other attribute goes to the <time>, with a ref. |
Built with
Installs with Clock
- Components
- Full Value





