# Relative Time Composition 1 - World clock layout

> Composed world clock with labels, dates, and times.

A shadcn/ui block from the [@shadcnblocks](https://shadcnblocks.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnblocks/relative-time-relative-time-composition-1).

- Page, with a live preview: https://shadcn.exchange/r/shadcnblocks/relative-time-relative-time-composition-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnblocks/relative-time-relative-time-composition-1-light-5bffd18fb3dc76e0.png
- Registry item: https://shadcnblocks.com/r/relative-time-relative-time-composition-1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnblocks.com/r/relative-time-relative-time-composition-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `https://www.kibo-ui.com/r/relative-time.json`

## Files

### `example/relative-time/relative-time-composition-1.tsx`

```tsx
"use client";

import {
  RelativeTime,
  RelativeTimeZone,
  RelativeTimeZoneDate,
  RelativeTimeZoneDisplay,
  RelativeTimeZoneLabel,
} from "@/components/kibo-ui/relative-time";

export const title = "World clock layout";

const zones = [
  { label: "SF", zone: "America/Los_Angeles" },
  { label: "NYC", zone: "America/New_York" },
  { label: "LON", zone: "Europe/London" },
  { label: "TYO", zone: "Asia/Tokyo" },
];

const Example = () => (
  <RelativeTime className="w-full max-w-md rounded-lg border p-4">
    <p className="mb-3 text-sm font-medium">World clock</p>
    {zones.map(({ label, zone }) => (
      <RelativeTimeZone key={zone} zone={zone}>
        <RelativeTimeZoneLabel>{label}</RelativeTimeZoneLabel>
        <div className="flex flex-col items-end gap-0.5">
          <RelativeTimeZoneDate />
          <RelativeTimeZoneDisplay />
        </div>
      </RelativeTimeZone>
    ))}
  </RelativeTime>
);

export default Example;
```
