Countdown
The time left until a moment: a link that expires, a maintenance window. It updates each second and says when the time is up.
import { Countdown } from '@sypnia/ui/react'
An invitation that expires
Code
import { Countdown } from '@sypnia/ui/react';
// How long a link stays valid. A fixed moment, so the server and the browser agree on it.
export default function Expiry() {
return <Countdown to="2026-12-31T23:59:00Z" label="The invitation link expires in" />;
} When to use it
Use it when
- Deadlines that matter to what the person is doing now.
Do not use it when
- Dates far away: write the date.
For everyone
- The exact moment is in the
timeelement and its title. - It is not a live region, so it does not interrupt each second.
Props
| Countdown | Type | Default |
|---|---|---|
torequired | string | number | Date | |
label | ReactNode | |
onEnd | (() => void) |