Skip to content
Sign upPro
BillingTrial countdownMenu

Trial countdown (Pro)

ProIncluded in $99

Days left in a trial and exactly what happens at the end, in plain words: a downgrade or a charge, when, and how much. As a card, a header chip, or the whole trial as a row of days.

ProHalfway through a two week trial, with what happens at the end said plainly.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/trial-countdown

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { TrialCountdown } from "@/components/ui/chatcn/pro/trial-countdown"

<TrialCountdown
  plan="Team"
  startedAt={trial.start}
  endsAt={trial.end}
  after={{ kind: "downgrade", to: "Free" }}
  onUpgrade={openCheckout}
/>

<TrialCountdown variant="chip" {...trial} onUpgrade={openCheckout} />

<TrialTimeline {...trial} reminderDaysBefore={2} />

The days left are the headline, amber in the last three. Under it, one sentence says what happens at the end: the plan drops to free and nothing is charged, or the card is charged a stated price on a stated day, with how to avoid it. Once the trial is over the sentence switches to the past tense. No countdown timers or fake urgency; honest renewal copy is what makes the upgrade button credible. variant="bar" is a one line strip for the top of an app, and variant="chip" a small pill for a header with a ring of the time left that opens checkout. TrialTimeline lays the whole trial out as a row of days: used days fill in, a Today marker glides along, the reminder and the last day carry their icons, and under it the three moments in order, today, the reminder email and the end, so people know you will warn them before anything changes.

Examples

States

ProA trial that charges with the price, two days left, ended, and the one line bar.

Props

PropTypeNotes
planstring
startedAt, endsAtDate | string
after{ kind: "downgrade"; to } | { kind: "charge"; price }What happens at the end
onUpgrade, onManage() => void
variant"card" | "bar" | "chip"
now, locale, labelsA fixed clock, formatting and every string
reminderDaysBeforenumber | falseTimeline only. When the reminder goes out. Default 2

Accessibility

  • A status region, so a screen reader hears the days left on arrival.
  • The progress bar is decorative; the days and the end are text.
  • The chip button is named by the whole headline plus Upgrade now; without onUpgrade the headline is read from hidden text.
  • The timeline's day strip is one image labelled with the days left; every moment under it is text, and the amber last days also say how many are left.

Motion

Timeline only: a newly used day fills upward and the Today marker glides to it, 300 ms with the ease out curve, both transforms. Nothing moves with reduced motion.