# Tick countdown

A countdown dial where one tick falls away every second.

Also called: countdown timer, countdown clock.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Sixty ticks, one falls each second. The last lit tick lets go and tumbles away in amber every second; when the minute turns the ring refills in a sweep. Preview: https://chatcn.dev/preview/tick-countdown-demo

The dial has sixty ticks, one per second of the minute. Every second the last lit tick lets go and falls away under gravity in amber, tumbling clear of the time, while the next one waits in amber. When the minute turns the ring refills in a clockwise sweep, and the digits roll the way the time is moving. Good for the run a scheduled agent is about to start, or a rate limit about to reset.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/tick-countdown
```

## Usage

```tsx
import { TickCountdown } from "@/components/ui/chatcn/pro/tick-countdown"

<TickCountdown endsAt={run.startsAt} label="Starts in" onDone={refresh} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `endsAt` | `number` | Epoch ms; the dial runs its own clock |
| `seconds` | `number` | Or drive it yourself |
| `label` | `ReactNode` | Over the time |
| `onDone` | `() => void` | Once, at zero, with `endsAt` |

## Accessibility

- A `timer` role labelled with the minutes and seconds left.

## Motion

- Ticks fall for about a second; the refill sweeps at 11 ms a tick. Reduced motion: ticks go out in place with no sweep.

Source: https://chatcn.dev/docs/components/tick-countdown