Installation
Theme
Mode

Data display

Due countdown

A small chip that shows how long until a task is due and changes color as the clock runs down — neutral days out, blue within a few, amber the day of, red in the final hour (pulsing), and overdue when the deadline passes. Time pressure you can read at a glance, anywhere a date appears.

$npx shadcn@latest add @orbit/due-countdown

Overview

Live — the top chip ticks down on its own; drag the slider to sweep a deadline from two weeks out all the way to overdue and watch the color and icon change.

Live countdown
Ticking against a deadline — updates every minute, pulses inside the final hour
Due in 1h 35m
2d 18h left
Due in 2d 18h

Every state

The six moments of a deadline, pinned to a fixed clock via the now prop so the grid never drifts.

Due in 1w
2 weeks out
Due in 2d
2 days out
Due in 9h
9 hours — due today
Due in 42m
42 min — critical
Due in 4m
4 min — pulsing
Overdue by 1h 35m
Overdue

The tiers

Five bands map remaining time to the theme's semantic colors, so a glance down a list sorts itself by what needs attention.

Far> 3 daysQuiet neutral — on the radar, no pressure
Upcoming≤ 3 daysPrimary blue — coming up this week
Soon≤ 24 hoursAmber — due today, worth a look
Critical≤ 1 hourRed, pulsing — act now
Overduepast dueRed with an × — the deadline passed

Sizes

md for table rows and cards; lg where the countdown is the headline.

size="md" · size="lg"
Due in 42mDue in 42m

Props

PropTypeDefaultDescription
dueDate | number | stringThe deadline. Overdue chips keep counting up in red.
nowDate | number | stringFixed clock override — the chip becomes deterministic and never ticks. Use for demos, tests, and snapshots.
size"md" | "lg""md"26px chip or 34px chip.
pulsebooleantruePulse the icon in the critical tier (final hour). The global reduced-motion guard also disables it.
tickIntervalnumber30000Uncontrolled tick cadence in ms — the text is minute-granular, so twice a minute is plenty.
…restHTMLAttributes<HTMLSpanElement>Forwarded to the root span, including ref and className.

Usage

The chip signals urgency, but color alone isn't enough — the text carries the same meaning for anyone who can't distinguish the hues.

Do

Pair color with text

“Due in 42m” says the same thing the red does. Never let hue be the only signal — it fails for color-blind users.

Don’t

Pulse everything

Reserve the pulse for the final hour. If every chip animates, the motion stops meaning “urgent” and just adds noise.

Do

Round sensibly

“2d 18h” far out, “42m” up close. Show the precision that matches the urgency rather than a raw timestamp.

Don’t

Forget the overdue case

A countdown that stops at zero hides the worst state. Keep counting up in red so a missed deadline stays visible.

Keyboard & accessibility

Every tier changes icon and wording along with color, and the pulse respects reduced motion.

Text“Due in 42m” carries the meaning without color
IconClock / alert / × changes with the tier — never hue alone
MotionPulse honors prefers-reduced-motion
nowFixed clock for deterministic tests and snapshots