component
Time Display
Live-updating clock with timezone support and clock icon.
depslucide-react
00:00:00 Dhaka
Installation
$shadcn add @yoavi/time-displayAbout
A minimal live clock that updates every second, respects a specified timezone, and renders with a mono font that fits editorial layouts. Uses Intl.DateTimeFormat under the hood for accurate timezone conversion.
Handles hydration safely by rendering an invisible placeholder on the server that matches the client's first render exactly.
Set the timezone prop to any valid IANA timezone like America/New_York, Europe/London, or Asia/Tokyo. The label auto-derives from the last segment.
Usage
import TimeDisplay from "@/components/time-display";
export default function Page() {
return (
<div>
<TimeDisplay timezone="Asia/Dhaka" />
<TimeDisplay timezone="Europe/Berlin" showLabel={false} />
</div>
);
}API Reference
TimeDisplay
PropType