HelpTribe.

OfficeCard

World clock card for displaying global office locations with real-time local time, timezone info, and open/closed status indicators.

Installation

$ npx shadcn@latest add office-card

Preview

πŸ‡ͺπŸ‡ΈSpain

Madrid

Open
14:32:18
Local Time (Madrid)

Multiple Offices

πŸ‡ͺπŸ‡ΈSpain

Madrid

Open
14:32:18
Local Time (Madrid)
πŸ‡ΊπŸ‡ΈUSA

New York

Closed
08:32:18
Local Time (New York)
πŸ‡΅πŸ‡°Pakistan

Islamabad

Open
17:32:18
Local Time (Karachi)
πŸ‡¦πŸ‡ͺUAE

Dubai

Open
16:32:18
Local Time (Dubai)

Usage (React/TSX)

import { OfficeCard } from "@/components/ui/office-card"

const offices = [
  { city: "Madrid", country: "Spain", flag: "πŸ‡ͺπŸ‡Έ", timezone: "Europe/Madrid" },
  { city: "New York", country: "USA", flag: "πŸ‡ΊπŸ‡Έ", timezone: "America/New_York" },
  { city: "Islamabad", country: "Pakistan", flag: "πŸ‡΅πŸ‡°", timezone: "Asia/Karachi" },
  { city: "Dubai", country: "UAE", flag: "πŸ‡¦πŸ‡ͺ", timezone: "Asia/Dubai" },
]

export default function GlobalOffices() {
  return (
    <div className="grid grid-cols-4 gap-4">
      {offices.map(office => (
        <OfficeCard
          key={office.city}
          {...office}
          time={getCurrentTime(office.timezone)}
          status={getStatus(office.timezone)}
        />
      ))}
    </div>
  )
}

Props

PropTypeDefaultDescription
citystringβ€”The city name.
countrystringβ€”The country name.
flagstringβ€”Emoji flag for the country.
timezonestringβ€”IANA timezone string (e.g., 'Europe/Madrid').
timestringβ€”Formatted time string to display.
status{ open: boolean, text: string }β€”Office status with open state and display text.
classNamestringβ€”Additional CSS classes to apply.