Plan Card
One plan or rank at one price: earlier price, note, features and a call to action; PlanGrid lays out several. Server-safe. During a price reduction, `lowestPrice` shows the lowest price from the 30 days before it as visible text; the EU's Omnibus rule (Art. 6a of Directive 98/6) asks for this. A pointer, not legal advice: your app owns the price history and passes it only during a promotion, and no discount percentage is computed.
Iron
A month to try it out.
$9.99for 30 days
- Iron name colour
- Chat tag
Gold
SaleYours for good.
$149now $129forever
Lowest price in the 30 days before the reduction: $149
- Gold name colour
- Chat tag
- Cosmetic trail
import { PlanCard, PlanGrid } from "@/components/blocks/plan-card";import { buttonVariants } from "@/components/ui/button-variants";export function RankCards() { return ( <PlanGrid> <PlanCard name="Iron" price={9.99} note="for 30 days" features={["Iron name colour"]} cta={ <a className={buttonVariants({ variant: "outline", className: "w-full", })} href="/buy/iron" > Buy </a> } /> <PlanCard name="Gold" price={129} compareAt={149} lowestPrice={149} note="forever" badge="Sale" featured features={["Gold name colour", "Cosmetic trail"]} cta={ <a className={buttonVariants({ className: "w-full" })} href="/buy/gold" > Buy </a> } /> </PlanGrid> );}<PlanCard>
One plan or rank at one price, no state, so it renders on the server. Several go in a PlanGrid.
name requiredstringPlan name, the card's heading.price requiredReactNodeCurrent price in major units, or your own node (Pricing passes its animated price).badgestringSmall label on the card, e.g. "Popular".compareAtnumberStruck-through earlier price. Hidden when a numericpriceisn't lower.ctaReactNodeCall to action, e.g.<Button className="w-full">Buy</Button>.currencystringISO 4217 code for the price.descriptionReactNodeOne line under the name.featuredbooleanOutlined in the accent.featuresDefault[]string[]What the plan includes, one check mark each.localestringBCP 47 locale for number formatting.lowestPricenumberLowest price from the 30 days before a reduction, shown as text under the price. Pass it only during a promotion.lowestPriceLabelDefault"Lowest price in the 30 days before the reduction"ReactNodeText beforelowestPrice. Polish: "Najniższa cena z 30 dni przed obniżką".noteReactNodeBeside the price, e.g. "/ month" or "forever".nowLabelDefault"now"stringRead by screen readers betweencompareAtand the price.
| Prop | Type | Default |
|---|---|---|
name requiredPlan name, the card's heading. | string | — |
price requiredCurrent price in major units, or your own node (Pricing passes its animated price). | ReactNode | — |
badgeSmall label on the card, e.g. "Popular". | string | — |
compareAtStruck-through earlier price. Hidden when a numeric price isn't lower. | number | — |
ctaCall to action, e.g. <Button className="w-full">Buy</Button>. | ReactNode | — |
currencyISO 4217 code for the price. | string | — |
descriptionOne line under the name. | ReactNode | — |
featuredOutlined in the accent. | boolean | — |
featuresWhat the plan includes, one check mark each. | string[] | [] |
localeBCP 47 locale for number formatting. | string | — |
lowestPriceLowest price from the 30 days before a reduction, shown as text under the price. Pass it only during a promotion. | number | — |
lowestPriceLabelText before lowestPrice. Polish: "Najniższa cena z 30 dni przed obniżką". | ReactNode | "Lowest price in the 30 days before the reduction" |
noteBeside the price, e.g. "/ month" or "forever". | ReactNode | — |
nowLabelRead by screen readers between compareAt and the price. | string | "now" |
required
Also accepts every <div> prop.
<PlanGrid>
PlanCards side by side, as many columns as fit.
Also accepts every <div> prop (none of its own).
Every component also takes className.