HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Meter
  • Multi Select
  • Native Select
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sonner
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Countdown

PreviousNext

Days, hours, minutes and seconds until a date, with each changing unit popping in. Comes boxed or compact.

Base UIReact AriaRadix UI
Early bird pricing ends
Fraser Valley Business Summit, 15 January 2027.
--days
:
--hours
:
--minutes
:
--seconds
Seat held for

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/countdown.json

Usage#

import { Countdown } from "@/components/ui/countdown"
<Countdown target="2027-01-15T09:00:00-08:00" />
 
<Countdown
  variant="compact"
  target={holdEndsAt}
  onComplete={() => releaseSeat()}
/>

Server rendering#

Countdown never reads the clock while it renders. The first paint shows dashes, and the real time arrives in an effect. That keeps the page safe to prerender with Cache Components, and the server and browser always agree.

If you build the target from the current time, do it in an effect or an event handler, not during render.

Props#

  • target. A Date, a date string or a timestamp.
  • variant. boxed (the default) puts each unit in its own card. compact is one inline line, like 4m 09s.
  • onComplete. Runs once when the count hits zero, or straight away if the target has already passed. The success sound only plays when it hits zero while the page is open.
  • hideDays, hideSeconds. Days hide on their own when there are none left. hideDays folds them into the hours.
  • completeLabel. Shown in place of the zeros once it is done.

useCountdown(target) is exported too, for a custom layout. It returns null until mounted.

Copy ButtonData Grid

On This Page

InstallationUsageServer renderingProps