Skip to content
synccn

Countdown

Live days, hours, minutes and seconds to a date.

Launch in

--days
:
--hours
:
--minutes
:
--seconds

Installation

$ pnpm dlx shadcn@latest add @synccn/countdown

First time in this project? Connect synccn with one command.

Usage

import { Countdown } from "@/components/ui/countdown";<Countdown to="2027-01-01" />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Countdown

Live countdown to a date. Shows `done` when it reaches zero. Safe to server-render: the digits fill in once the page loads.

  • torequired
    string | number | Date

    Target time.

  • done
    React.ReactNode

    Default "It's here"

    Shown when the time is reached.

  • labels
    boolean

    Default true

    Show unit labels under the numbers.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: timer
  • ARIA attributes: aria-live
  • Announces changes to screen readers