shadcn.io is not affiliated with official shadcn/ui
Trial Pace Onboarding Block for React
A time-tracking app's trial panel: days remaining counted from a fixed date, three limit meters each with a tick for an even pace, a worked-out line on when each limit would run out, and a ghost button that asks for 7 more days.
Installation
Overview
Tell people how their trial is going, not only how long it has left, with this trial panel for React with Base UI. It is the trial card of Hourby, a time-tracking app: a header, then a framed panel with the days remaining (rolling digits) and the day the trial ends, three ruled rows for the plan's limits (Projects, Reports, Teammates), and a foot with the one Shine Button, Choose a plan, and a ghost button that asks for seven more days. Each row has its count, a Progress bar with a tick for where an even pace would put you today, and a line worked out from the days gone and the amount used: "At this pace Projects run out on day 8, before the trial ends." Every date is counted from one fixed "today" in the code, so the page reads the same for everyone. On a phone the rows and the foot stack. For any product with a time-limited trial and a few plan limits.
FAQ
How are the days worked out, and where is today?
From three constants: STARTED_ON, TRIAL_DAYS and AS_OF. The days gone are the whole days between the first and the last, the days remaining are the trial's length less those, and the end date is the start plus the length, all as day numbers from Date.UTC, so there is no time zone or clock involved. In your app set AS_OF to the current date (and read it on the server, so the first paint agrees) and STARTED_ON to the account's trial start.
What do the tick and the sentence mean?
The tick is where the bar would be today if the whole limit were used evenly over the trial: days gone over trial length. A bar past it is over pace, and the sentence says so. The sentence takes what is used so far, works out the daily rate and says on which day the limit would be reached if that rate held, "before the trial ends", on its last day, or never within it ("last the whole trial"). It is arithmetic on typed usage, not a prediction, and says "at this pace".
What does Ask for 7 more days do?
In the demo it lengthens the trial by seven days as if the request were granted: the days remaining roll up, the end date moves, the ticks move back and the sentences change. Pressing it again withdraws the request and everything returns. The status line says so ("Requested in this demo") because nothing is sent. In your app, send the request to your team and leave the figures alone until it is approved.
What stays local in the demo, and how do I wire it?
The usage numbers, the dates, the request and the Choose a plan press all live in the page; nothing is bought, requested or stored. Fill LIMITS from your metering, point Choose a plan at your plan picker and the ghost button at your sales form or extension endpoint.
Is it accessible?
Each limit is a heading with its count in text, and the bar is decorative because the count and the sentence say the same in words; colour carries nothing, only the bar's length and the tick. Both buttons are ordinary buttons reached by Tab, and the status line is a polite live region that is empty until you press one.
How does it look on a phone?
The panel keeps its single column. The days remaining and the end date are on top, each limit row stacks its heading, bar and sentence, and in the foot Choose a plan is first and full width with the ghost button under it. The sentences reserve two lines so a longer one never moves the row beneath.
Related
- 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.
- 6d 22hPro
Trial Countdown Banner
CountdownsA trial notice for a writing app: a clock, a sentence with the time left ticking, a line on what upgrading keeps, a Shine Button to upgrade and a dismiss button that folds the block away.
- Pro
Usage Meters Billing
Plan and usageUsage meters for an app's settings: one row per quota with its count, a bar that turns to a warning tone at 80% and an over-limit tone past 100%, and a plain line on what happens next.
- Pro
Trial Timeline Success
Plans and limitsA trial confirmation page: fourteen day cells on shared hairlines with today filled and the reminder day marked, the first charge named, a switch for the reminder email, and the three features the trial unlocks.
- Pro
A sprint planning service's trial-ending notice: a strip of 14 day cells with today ringed, a Keep Pro or Move to Free choice that diffs six features, and a one-time seven-day extension.
- Pro
Setup Checklist Onboarding
ChecklistsA contract tool's get-started guide as a setup panel: six steps in a single-open accordion with one button in the open step, a count that follows what you finish, a menu that hides completed steps or the guide, and a pill that opens it again.