Motionshelf
← All components

Commerce

Offer Countdown

A flip clock counts down to the real end of the offer, next to the real stock left.

Install

npx shadcn@latest add https://motionshelf-pi.vercel.app/r/offer-countdown.json

Copies the file into your project. Requires React 19, Tailwind CSS v4 and GSAP (installed as a dependency).

Props

NameTypeDefaultDescription
endsAtstring | number—When the offer ends (ISO date or timestamp in ms). Use the real deadline.
demoSecondsnumber8025Without endsAt (demo only): seconds left when it mounts.
titlestring"Launch offer"Small label at the top.
subtitlestring"Ends in"Line above the clock.
labels[string, string, string]["Hours", "Minutes", "Seconds"]Labels under the clock groups.
stocknumber7Units actually left. Use the real number.
totalnumber40Units at the start of the offer.
stockLabelstring"Only {n} left at this price"Stock line; {n} becomes the number left.
endedLabelstring"This offer has ended"Text shown when the time is over.
accentstring"#1f5bff"Color of the dot and the stock bar.
classNamestring""Extra classes for the outer element.

Dependencies

  • gsap
  • @gsap/react