Componentticket-stub0.95 KB gzipZero dependencies
Punch Clock
Punch clock with live digital time and in/out stamp feed.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add punch-clockOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { PunchClock } from "@/components/ui/punch-clock"; <PunchClock />Source code
punch-clock.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxpunch-clock.tsx71 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface PunchClockProps extends React.HTMLAttributes<HTMLDivElement> { employeeId?: string; onPunch?: (time: string, type: "in" | "out") => void;} /** Time punch clock: timestamp card + clock in/out tracking. */export function PunchClock({ employeeId = "EMP-042", onPunch, className, ...props }: PunchClockProps) { const [punches, setPunches] = React.useState<{ time: string; type: "in" | "out" }[]>([]); const [now, setNow] = React.useState<Date | null>(null); React.useEffect(() => { const init = setTimeout(() => setNow(new Date()), 0); const t = setInterval(() => setNow(new Date()), 1000);Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { PunchClock } from "@/components/ui/punch-clock"; <PunchClock />| Prop | Type | Description |
|---|---|---|
| employeeId | string | Configures employee id. (Default: "EMP-042") |
| onPunch | (time: string, type: "in" | "out") => void | Callback invoked on punch. |