Loyalty Program Dashboard
A loyalty program dashboard for a signed-in member: a points balance hero number, a progress bar toward the next membership tier, a grid of redeemable benefit cards with their points cost, and a list of ways to earn more points.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/loyalty-program-dashboard.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/ecommerce/ecommerce21.tsx instead.
Usage
The file also exports ecommerce21Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Ecommerce21, ecommerce21Demo } from "@/components/blocks/ecommerce/ecommerce21"; export default function Page() { return <Ecommerce21 {...ecommerce21Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| memberName | string | undefined | Shown in a "Welcome back, ..." line above the points balance; omitted entirely when not set. |
| currentTier | string | none | Current tier name, shown as a badge and as the left label on the progress bar. |
| nextTier | string | none | Next tier name, shown as the right label on the progress bar. |
| currentPoints | number | none | Member's current points balance. |
| pointsForNextTier | number | none | Points required to reach nextTier; used with currentPoints to compute the progress bar fill. |
| benefits | LoyaltyBenefit[] | [] | Redeemable benefit cards; the whole "Redeem your points" section is hidden when empty. |
| earningOpportunities | EarningOpportunity[] | [] | Ways-to-earn list; the whole "Ways to earn more" section is hidden when empty. |
| className | string | none | Extra classes for the outer section element. |
Types
type LoyaltyBenefit = { name: string; pointsCost: number; description: string; }; type EarningOpportunity = { label: string; points: number; };
Behavior notes
- This is a static display dashboard, not an interactive redemption flow: each benefit card's "Redeem" button has no click handler, since actually redeeming points requires a backend to debit the member's balance, which this block doesn't have.
- The progress bar fill is computed at render time from currentPoints / pointsForNextTier (clamped to 100%); it's a plain server component, there's no animation or client state involved.
- If currentPoints already meets or exceeds pointsForNextTier, the caption below the bar switches from "N points to reach {nextTier}" to "You've reached {nextTier}" instead of showing a negative number.
More Ecommerce Blocks
View all →wishlist-manager
Wishlist Manager
Saved-items list with stock-status badges, move-to-cart and remove actions, and a real empty state.
product-information-tabs
Product Information Tabs
Tabbed product details with Description, Features, Specifications, Reviews, and Shipping panels.
collection-showcase-grid
Collection Showcase Grid
A large featured-collection hero card alongside a grid of smaller supporting collection tiles.
shop-by-brand-grid
Shop by Brand Grid
A grid of bordered brand tiles with a wordmark-style name, product count, and a hover affordance.
sale-countdown-timer
Sale Countdown Timer
A live days/hours/minutes/seconds countdown in default, compact, or full-width banner layouts.
gift-card-redemption-form
Gift Card Redemption Form
A code-entry form that validates against a fixed list of demo gift cards and shows a real success or error state.