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 playgroundAbout
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
npm i @ashutoshswamy/smouiUsage
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.
booleandefaulttrue
More pricing components
- BillingToggleMonthly/yearly switch. The thumb stretches to the choice and a savings badge pops in on yearly.
- OrderSummaryA checkout total. Type a promo code and a discount line slides in while the total rolls down; a wrong code shakes the field.
- PlanCompareFeature comparison. One column highlight stretches to the column you point at; rows and ticks cascade in.
- PlanPickerPlans as a radio list. One tinted block glides to the chosen plan, the radio fills with a pop and arrow keys move the choice.
- PricingCardOne plan card. Price rolls with billing, features tick in on scroll, the featured card sits on grainy mesh.
- PricingSliderUsage-based pricing. Drag the jelly thumb through tiers; the label rides its bubble and the price rolls.