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-cardPreview
πͺπΈSpain
OpenMadrid
14:32:18
Local Time (Madrid)
Multiple Offices
πͺπΈSpain
OpenMadrid
14:32:18
Local Time (Madrid)
πΊπΈUSA
ClosedNew York
08:32:18
Local Time (New York)
π΅π°Pakistan
OpenIslamabad
17:32:18
Local Time (Karachi)
π¦πͺUAE
OpenDubai
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
| Prop | Type | Default | Description |
|---|---|---|---|
| city | string | β | The city name. |
| country | string | β | The country name. |
| flag | string | β | Emoji flag for the country. |
| timezone | string | β | IANA timezone string (e.g., 'Europe/Madrid'). |
| time | string | β | Formatted time string to display. |
| status | { open: boolean, text: string } | β | Office status with open state and display text. |
| className | string | β | Additional CSS classes to apply. |