Staaarter

Deal of the Day Hero

A large featured-product hero with a live countdown, a discount badge, and a feature list, built to create urgency around a single deal. Meant for a homepage or promotions page spotlighting one product, not a grid of multiple deals.

By Staaarter Team
Ecommerce
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/deal-of-the-day-hero.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/ecommerce/ecommerce28.tsx instead.

Usage

The file also exports ecommerce28Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Ecommerce28, ecommerce28Demo } from "@/components/blocks/ecommerce/ecommerce28";

export default function Page() {
  return <Ecommerce28 {...ecommerce28Demo} />;
}

Props

PropTypeDefaultDescription
badgeLabelstring"Deal of the Day"Label on the primary badge.
discountLabelstring"-40%"Label on the discount badge.
productNamestringnoneFeatured product's name.
descriptionstringundefinedShort paragraph under the product name.
originalPricestringnonePre-formatted original price, shown struck through.
salePricestringnonePre-formatted sale price, shown at full size.
featuresstring[][]Bullet list of product highlights.
durationSecondsnumber8 * 3600 + 24 * 60 + 15Fixed countdown length in seconds; ticks down once per second from this literal, never derived from the system clock.
ctaLabelstring"Claim this deal"Label on the CTA button.
ctaHrefstring"#"Destination for the CTA button.
image{ src: string; alt: string }undefinedFeatured product photo; falls back to a centered ShoppingBag icon when omitted.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The countdown starts from the fixed durationSeconds literal and decrements once per second via setInterval; it never reads Date.now() or a target Date, so it does not reflect real wall-clock time and simply restarts from the same duration on every page load.
  • When the countdown reaches zero it stays at 00:00:00 rather than looping or hiding, since this is a decorative urgency timer, not a real deal-expiry mechanism.
  • The CTA is a real Link-backed button (navigates to ctaHref); the countdown itself has no effect on whether the button is clickable.
  • A missing image falls back to a centered ShoppingBag icon on a muted background instead of a broken image.