Skip to content
New

Offer, deal

beta

One offer beside a photo: what it includes, the new price and the usual one struck through, and a countdown to its end.

npx rasengan-ui add offer-deal
A whole grilled fish on a large platter with onions.
Christmas menu

The family platter

Braised fish, ndolé, poulet DG, plantain and miondo for six, with a jug of folere.

FCFA 18,000Usual price FCFA 24,000

Until Thursday, 24 December 2026 at 23:00

Order the platter
Use it
A deal of the day, a seasonal menu, a combo or a promotion with an end date.
Avoid it
Several offers at once, or prices that never change: menu-cards.

Installation

Terminal
npx rasengan-ui add offer-deal

It installs into components/blocks/offer-deal/, with what it uses (Badge, Button, Number Roll) and lib/blocks.ts.

Usage

Without content, the block shows its example. Pass your own, typed by the block's schema, from a content file (here, the example with one field changed):

app/_routes/index.page.tsx
import { OfferDeal } from "@/components/blocks/offer-deal";
import { home } from "@/content/home";
 
export default function Home() {
  return <OfferDeal content={home.offer} />;
}
content/home.ts
import { example, type OfferDealContent } from "@/components/blocks/offer-deal";
 
export const home = {
  offer: { ...example, offer: { ...example.offer, title: "Lunch combo" } } satisfies OfferDealContent,
};

With offer.endsAt (ISO 8601 with its offset), the end date is written in timeZone, then days, hours and minutes count down once the page has loaded. Past the end, the action goes and labels.expired says the offer has ended. Without endsAt, there is no countdown.

Content

FieldTypeLimitsGuidance
eyebrowoptionalstring≤ 32 charsAbove the title: 'Deal of the week', 'Christmas menu'.
offerobject
offer.titlestring1–48 chars
offer.descriptionoptionalstring≤ 140 charsWhat it includes.
offer.priceobject
offer.price.amountnumber≥ 0
offer.price.currencystring3–3 charsAn ISO 4217 code: 'EUR', 'USD', 'XAF'.
offer.wasoptionalobjectThe usual price, shown struck through.
offer.was.amountnumber≥ 0
offer.was.currencystring3–3 charsAn ISO 4217 code: 'EUR', 'USD', 'XAF'.
offer.endsAtoptionalstringdate-timeWhen the offer ends, ISO 8601 with its offset; a countdown runs to it.
offer.ctaoptionalobject
offer.cta.labelstring1–32 charsA verb first, two to four words: 'Start free', 'Book a table'.
offer.cta.hrefstringA path ('/pricing'), an anchor ('#menu'), or a full URL.
imageoptionalobjectThe dish, the product or the treatment on offer, landscape (4:3).
image.srcstringA local path ('/images/terrace.jpg') or the project's asset URL.
image.altstring≤ 140 charsWhat the image shows, for people who cannot see it. Empty only if purely decorative.
image.widthinteger
image.heightinteger
timeZonestring≥ 3 charsThe business's IANA time zone, to write the end date: 'Africa/Douala'.
localeoptionalstringA BCP 47 locale for prices and dates ('en-CM'); the page's language when left out.
labelsobjectThe countdown appears once the page has read the clock; the end date is written before that.
labels.wasstring1–24 charsRead before the struck-through price: 'Usual price'.
labels.untilstring1–24 charsBefore the end date: 'Until'.
labels.endsInstring1–24 charsBefore the countdown: 'Ends in'.
labels.expiredstring1–80 charsOnce it has ended: 'This offer has ended. See you for the next one.'
labels.daysstring1–12 chars'days'
labels.hoursstring1–12 chars'hours'
labels.minutesstring1–12 chars'min'

Props

PropNotes
contentOfferDealContent; the example when left out
idthe section's id, for anchor links; "offer" by default
headingLevel1, 2 or 3: the heading's tag; 2 by default
classNameon the <section>, for spacing

Accessibility

  • The usual price is read as such (labels.was) before the struck-through amount.
  • The countdown is hidden from screen readers, which read the end date instead: it does not chatter every minute.