Componentmedia0.48 KB gzipZero dependencies

LiveClock

Digital clock showing HH:MM:SS with optional timezone and variant support

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add live-clock

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { LiveClock } from "@/components/ui/live-clock" <LiveClock timezone="UTC" variant="digital" />

Source code

live-clock.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxlive-clock.tsx48 lines
"use client";import * as React from "react";import { cn } from "./lib/utils"; export type LiveClockProps = {  timezone?: string;  variant?: "digital" | "badge";}; const LiveClock = ({ timezone, variant = "digital" }: LiveClockProps) => {  const [time, setTime] = React.useState<Date | null>(null);   React.useEffect(() => {    const start = setTimeout(() => setTime(new Date()), 0);    const tick = setInterval(() => setTime(new Date()), 1000);    return () => {      clearTimeout(start);      clearInterval(tick);

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { LiveClock } from "@/components/ui/live-clock"; <LiveClock />
PropTypeDescription
timezonestringOptional IANA timezone name (e.g. 'America/New_York')
variant"digital" | "badge"Display variant: digital or badge