Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Beta Ended Error Block for React

A full-screen page for the end of a beta: a drawn tester card with figures counted from dates, a perforated discount ticket with a copyable code, and a Claim 35% off button that recomputes the first-year price from whole cents.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Thank beta testers and show them what they earned, with this beta ended page for React with Base UI. It's the screen of Driftwrite, a writing app, a whole screen with the page's rails and one band across it, split in two. At the end, the copy: the heading, one sentence, the first-year price worked out in whole cents ($9.99 a month, $119.88) and a Shine Button, Claim 35% off, which rewrites the price to $77.92 with the old one struck. At the start, framed by Guides, a tester card (monogram, name, and the days of beta, notes sent and features tried) and a discount ticket with a perforated edge that holds the code BETA35 and a Copy Button. Export my drafts is a Download Trigger. It's built from Copy Button, Download Trigger, Button, Shine Button and Guides, with a CSS entrance only. For any product that ends a beta and rewards the people who tested it.

FAQ

Where do the figures on the card come from?

The days of beta are counted from two typed ISO dates (the day the tester joined and "today" for the page), and so are the days since the beta ended and the days the ticket is valid. Notes sent and features tried are typed counts. Nothing reads the visitor's clock, so the server and every browser print the same numbers. Replace the constants with the account's own history.

How is the discounted price worked out?

In whole cents: 999 a month times 12 is 11,988, and 35% off is Math.round(11988 * 65 / 100), 7,792 cents, which Intl.NumberFormat prints as $77.92. Working in cents keeps the sums exact, and the same two numbers draw the old price and the new one.

What does Claim 35% off do, and what stays in the page?

It records the claim in the page's state, rewrites the price line, fills the ticket's "claimed" line and says "35% off claimed in this demo: $77.92 for the first year. Nothing was charged." Undo takes it back, and a second press says it is already claimed. To wire it for real, apply the code to the subscription with your billing provider where the code says so.

Does Copy code really copy?

Yes: it writes BETA35 to the clipboard and says so in the page's status line. If the browser refuses (no permission, or a page that isn't served over HTTPS) the line says that instead, and the code stays on the ticket to select by hand.

Why is the card first on a wide screen but the copy first in the code?

Reading order follows the copy: heading, price and button come first for keyboard and screen reader users and on a phone. On a wide screen the card and ticket are drawn at the start with a grid placement, without changing that order, so the button is still the first thing you tab to.

Does this return an error status?

No: a component can't. The page is shown after a login or a gated action in your app, so decide the status there, a 403 for a gated action once the beta is closed, and send it from the server.

  • Pro

    Trial Expired Error

    Plans and checkout

    A full-screen page for a trial that has ended: what the trial built, how long the data is kept with a bar for the days used, a real export, and two plan cells whose button names the plan you picked.

  • Pro

    Trial Banner Billing

    Upsell and retention

    A 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.

  • Pro

    Subscription Required Error

    Plans and checkout

    A full-screen 403 for a feature the plan does not include: the facts, what Pro adds, and an editable message that asks the workspace owners, with a Viewing as demo control that turns the ask into an upgrade with the price worked out.

  • Pro

    A full-height page for a web app tab running a retired version: a ruler of five releases with the supported range shaded and You are here marked, a radio group to read each release, three changes in 5.0 and a reload button.

  • Pro

    A full-height page for a feature that is not on for your workspace yet: three conditions ruled from rail to rail, a rollout meter with the next wave, and a Switch that joins early access and flips the last condition.

  • Pro

    A full-height maintenance page for an online bank that shows a five-segment progress bar with the window's start and expected return, and a Check again button that reports a typed result.