shadcn.io is not affiliated with official shadcn/ui
Pricing Hint Top Bar Banner Block for React
A top bar for a notes app that teases its annual price: the percentage off worked out from the two prices, the monthly price struck through, the annual one beside it and an Upgrade link.
Installation
Overview
A top bar for React with Base UI, a price teaser that takes one line and carries its own arithmetic. Ploverware's strip sits between the page's rails with no tint and no close: "Annual plans are 53% off", the monthly $19 struck through, the annual $9/mo in medium weight and an underlined "Upgrade" link with an arrow that turns around in right-to-left layouts. The 53 is not typed: it is worked out from the two prices, so changing either one corrects the line (19 to 9 is 52.6, rounded). There is no end date and no countdown, so it never goes stale. It is 44 pixels tall on a desktop and two lines at most on a phone. It follows your theme and is built from Guides alone, with no component beyond it.
FAQ
How do I change the prices?
Edit PRICE at the top of the file: monthly is the price you pay by the month, annual the monthly price on the annual plan, plus the link's words and address. The percentage is OFF, computed as one minus the annual price over the monthly one, rounded to a whole number, so the headline and the figures beside it can't disagree. Keep the figures in the same currency; for another one, change the symbol in the two spans.
How does a screen reader read the struck price?
Struck text is often read like any other, so the line adds two visually hidden pieces: "was" before the monthly price and ", now" before the annual one. A screen reader reads "Annual plans are 53% off: was $19, now $9/mo, Upgrade". The prices sit in one span with dir="ltr", so the currency symbols and digits keep their order in a right-to-left page.
Why is there no close button?
A pricing hint is a standing line, not a notice: nothing in it expires, and it takes no more room than a nav link. If you want one that can be put away, the dismissible top bar shows the fold, the focus move and the status line you would add.
Can I add an end date?
Show a date only if you generate it, from your server or a countdown that starts in the browser (see the countdown banners). A typed calendar date goes stale and leaves a banner that is wrong. The block leaves it out for that reason.
Related
- Pro
Top Bar Banner
Top barsA slim announcement strip for a writing app's release: one centred line with the version, the news and an underlined link, and a ghost button that folds the strip away.
- Pro
Trial Banner Billing
Upsell and retentionA trial-ending banner for an app's shell: days left in the heading, a progress bar, what changes when the trial ends, an Add payment method action and a dismiss that remembers.
- 021434Pro
Flash Sale Countdown Banner
CountdownsA flash-sale countdown for a lighting shop: the product with its struck regular price and sale price, a clock of hours, minutes and seconds in three cells, a Shine Button to claim the price, and a thin meter of how much stock is claimed.
- 40%Pro
Two-Tone Split Banner
Split calloutsA seasonal offer on a split: a tinted half with 40% off in display type, and a plain half with the struck list price, the worked-out sale price per seat and a Shine Button.
- Pro
New Feature Top Bar Banner
Top barsA top bar for a collaborative editor with an outline New chip, one line of news and a See it button that opens a popover preview of the feature, with a close at the end.
- Pro
Trial Upgrade Multi-Action Banner
Choices and promptsA trial prompt card for a video editor that sets what you have now beside what stays after the trial, in two columns, with upgrade, compare and remind-me-later actions.