Staaarter

Welcome Discount Banner

New customer promotion with large discount display, copyable promo code, benefit checklist, and CTA. Perfect for first-time visitor offers and marketing campaigns.

By Staaarter Team
Food
Docs
Live preview

Docs

Installation

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

npx shadcn add https://staaarter.com/r/welcome-discount-banner.json

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

Usage

The file also exports food18Demo, 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 { Food18, food18Demo } from "@/components/blocks/food/food18";

export default function Page() {
  return <Food18 {...food18Demo} />;
}

Props

PropTypeDefaultDescription
headingstringnoneBanner heading.
descriptionstringnoneShort intro line below the heading.
discountLabelstringnoneLarge discount display text, e.g. "20% OFF".
promoCodestringnonePromo code shown in the copyable code box.
benefitsstring[][]Checklist of offer benefits below the promo code.
ctaLabelstringnoneLabel for the CTA button.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The promo code box is real client interactivity: clicking it calls navigator.clipboard.writeText(promoCode) and swaps the label to "Copied!" with a check icon for 2 seconds before reverting.
  • If the Clipboard API throws (denied permission or an unsupported browser), the copy silently no-ops and the button label stays "Copy code" so the user can try again.
  • The benefits checklist only renders when the benefits array has entries.
  • The CTA button is decorative and inert: there is no real ordering or checkout flow wired up.