Offer, deal
betaOne offer beside a photo: what it includes, the new price and the usual one struck through, and a countdown to its end.
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
- 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.
- Built with
- BadgeButtonNumber Roll
- Pairs with
- Menu, cardsOrder, banner
Installation
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):
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
| Field | Type | Limits | Guidance |
|---|---|---|---|
eyebrowoptional | string | ≤ 32 chars | Above the title: 'Deal of the week', 'Christmas menu'. |
offer | object | ||
offer.title | string | 1–48 chars | |
offer.descriptionoptional | string | ≤ 140 chars | What it includes. |
offer.price | object | ||
offer.price.amount | number | ≥ 0 | |
offer.price.currency | string | 3–3 chars | An ISO 4217 code: 'EUR', 'USD', 'XAF'. |
offer.wasoptional | object | The usual price, shown struck through. | |
offer.was.amount | number | ≥ 0 | |
offer.was.currency | string | 3–3 chars | An ISO 4217 code: 'EUR', 'USD', 'XAF'. |
offer.endsAtoptional | string | date-time | When the offer ends, ISO 8601 with its offset; a countdown runs to it. |
offer.ctaoptional | object | ||
offer.cta.label | string | 1–32 chars | A verb first, two to four words: 'Start free', 'Book a table'. |
offer.cta.href | string | A path ('/pricing'), an anchor ('#menu'), or a full URL. | |
imageoptional | object | The dish, the product or the treatment on offer, landscape (4:3). | |
image.src | string | A local path ('/images/terrace.jpg') or the project's asset URL. | |
image.alt | string | ≤ 140 chars | What the image shows, for people who cannot see it. Empty only if purely decorative. |
image.width | integer | ||
image.height | integer | ||
timeZone | string | ≥ 3 chars | The business's IANA time zone, to write the end date: 'Africa/Douala'. |
localeoptional | string | A BCP 47 locale for prices and dates ('en-CM'); the page's language when left out. | |
labels | object | The countdown appears once the page has read the clock; the end date is written before that. | |
labels.was | string | 1–24 chars | Read before the struck-through price: 'Usual price'. |
labels.until | string | 1–24 chars | Before the end date: 'Until'. |
labels.endsIn | string | 1–24 chars | Before the countdown: 'Ends in'. |
labels.expired | string | 1–80 chars | Once it has ended: 'This offer has ended. See you for the next one.' |
labels.days | string | 1–12 chars | 'days' |
labels.hours | string | 1–12 chars | 'hours' |
labels.minutes | string | 1–12 chars | 'min' |
Props
| Prop | Notes |
|---|---|
content | OfferDealContent; the example when left out |
id | the section's id, for anchor links; "offer" by default |
headingLevel | 1, 2 or 3: the heading's tag; 2 by default |
className | on 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.