Componentmedia1.31 KB gzipZero dependencies
Stopwatch
Precision timer with lap tear-offs and digital readout.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add stopwatchOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Stopwatch } from "@/components/ui/stopwatch"; <Stopwatch autoStart onLap={(lap) => console.log(lap)} />Source code
stopwatch.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxstopwatch.tsx183 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface LapRecord { lap: number; time: number; // in milliseconds formatted: string;} export interface StopwatchProps extends React.HTMLAttributes<HTMLDivElement> { autoStart?: boolean; onLap?: (lap: LapRecord) => void; className?: string;} export function Stopwatch({Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { Stopwatch } from "@/components/ui/stopwatch"; <Stopwatch />| Prop | Type | Description |
|---|---|---|
| autoStart | boolean | Toggles auto start. (Default: false) |
| onLap | (lap: LapRecord) => void | Callback invoked on lap. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |