Black Friday bar with promo code
A limited-time offer bar: countdown to a fixed date, one-click copyable promo code and a fallback message once the offer is over.
- Tailwind
- React
- CSS
- WordPress
Description
For Black Friday, sales or a flash sale, to place at the top of every page. The end date is set in the data-bfcr-end attribute in ISO format with its time zone (2026-11-30T23:59:59+01:00 in the example): the countdown in days, hours, minutes and seconds is the same for every visitor wherever they are, and catches up as soon as the tab is visible again. The “Copy the code” button puts the code in the clipboard and confirms it; if the browser refuses, the code is selected and a message invites the visitor to copy it with the keyboard. At the set time, the offer, countdown and code give way to a readable closing message with a link to upcoming offers, without reloading the page. Accessibility: a region named “Offre Black Friday”, a timer (role timer) read as a sentence that only changes once a minute instead of ticking digits, copying announced in a status region, a 44 px button, visible focus moved to the closing message if the offer ends while the button has focus, AA contrast in light and dark mode, French typography (non-breaking spaces, lang="fr"). With prefers-reduced-motion the seconds disappear and the display changes once a minute. Without JavaScript the offer, end date and code stay readable and the useless copy button is hidden. The bar wraps onto three compact lines on mobile from 360 px. The React version takes end and code props and only shows the countdown after hydration. Example: 30% off at a household linen maker.
Code
Loading the code…
The code of this component in
Archive contents
bandeau-black-friday-compte-a-rebours-html-tailwind.zip3 files · 7 Ko
- index.html11 Ko
- README.md5 Ko
- LICENSE.md1 Ko
Tags
Updated on December 2, 2026.
Reviews
No reviews yet.
In the same spirit

A sales card showing the discount that grows with the cart amount (-10% from €50, -15% from €100…) with a progress bar towards the next tier.
- Tailwind
- React
- CSS
- WordPress

A Christmas gift guide filtered by budget and theme, with the number of ideas announced and an empty state offering to show everything again.
- Tailwind
- React
- CSS
- WordPress

The last order dates for delivery before Christmas, per shipping method, with the days left worked out from the visitor’s date.
- Tailwind
- React
- CSS
- WordPress

A cart that shows live how much is left to add for free shipping, with a progress bar and recalculated totals.
- Tailwind
- React
- CSS
- WordPress