HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • Artwork
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Brand SVG
  • 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
  • Form Guide
  • Hover Card
  • Icon Tile
  • Image Export
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • League Table
  • Marquee
  • Match Score
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • 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
  • Sortable
  • Spinner
  • Stat
  • Stat Tabs
  • 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
  • CRM
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • App Shell
  • Record Files
  • Settings Shell
  • Help Panel
  • Note Editor
  • Email Drafts
  • Task List
  • Notifications Panel
  • Dual Pane Sidebar
  • Team Members Panel
  • Mix Pack Builder
  • Record Picker and Date Quick-pick
  • Record List
  • Record Page
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • AI Assistant
  • Voice Message
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Standings
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Templates
  • Sign In Page
  • Upload Page
  • Showcase Onboarding
  • Agreement Sign
  • Email
  • Email Composer
  • Share Dialog
  • Integrations
  • Transactions
  • Analytics
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.

UI SDKBase 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