PromoBanner

A coupon-style offer. Big digits roll down to the deadline, a bar drains with the time left, the code copies with a confirmation, and dismissing it collapses it on a spring. Pricing.

Open playground
Limited offerSpring sale: 30% off yearly plansApplies to every plan until the timer runs out.
06hours24mins00secsClaim offer

About

PromoBanner is a React component in the Pricing category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { PromoBanner } from "@ashutoshswamy/smoui" and set title, description, code among its 6 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { PromoBanner } from "@ashutoshswamy/smoui";

<PromoBanner
  title="Spring sale: 30% off"
  description="Applies to every plan."
  code="SPRING30"
  endsAt="2026-12-01T00:00:00Z"
  cta="Claim offer"
  href="/pricing"
/>

Props 6

title

The offer.

string
description

One supporting line under the title.

string
code

A promo code. Shown as a chip that copies and confirms.

string
endsAt / durationMs

ISO end date, or count down from mount.

string / number
cta / href

Button.

stringdefault "Claim offer" / "#"
dismissible

Show a close button.

booleandefault true