Ballmac UI home

Countdown

An SSR-safe timer with controlled or local seconds, pause support, and a completion announcement.

Your session closes in

Save your work before the timer ends.

Installation

$ pnpm dlx shadcn@latest add @ballmac/countdown

Usage

import { Countdown } from "@/components/ballmac/countdown"

The full example is in the Code tab above.

Examples

States and variants

Time remaining complete

API reference

PropTypeDefault
value

Controlled seconds remaining.

number—
defaultValue

Initial seconds remaining when uncontrolled.

number0
onValueChange

Called after a one-second tick.

(seconds: number) => void—
onComplete

Called once when an uncontrolled timer reaches zero.

() => void—
running

Pause or resume ticking.

booleantrue
label

Accessible purpose of the timer.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
NoneTimer is labelled; completion is announced

Use with AI

An SSR-safe timer with controlled or local seconds, pause support, and a completion announcement. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Countdown (@ballmac/countdown) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Show time until a short event
  • Display a temporary offer or session limit

Not for

  • Use progress for work completion

Registry JSON: https://ui.ballmac.com/r/countdown.json

Credits

Free to use in personal and commercial projects.

npm
None