Components › Display

Timer

A countdown or stopwatch with steady digits and start, pause and reset.

Installation

npx plankui@latest add timer

Usage

import { Timer } from "@/components/ui/timer";

<Timer duration={25 * 60} onComplete={notify} />

API reference

PropTypeDefaultDescription
durationnumberCount down from this many seconds. Leave out for a stopwatch.
autoStartbooleanfalseStart running on mount.
onComplete() => voidCalled once when a countdown reaches zero.
controlsbooleantrueShow start, pause and reset.
labelstring"Countdown" or "Stopwatch"Accessible name.

View the source on GitHub