Loyalty points overview — Storefront block
Prostorefront-loyalty-points-overview · for account pages
Loyalty points overview
The balance, where the customer stands on the merchant’s tiers and what the next one unlocks, and the latest movements.
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/storefront-loyalty-points-overviewUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontLoyaltyPointsOverview from '@/components/trame/blocks/storefront/storefront-loyalty-points-overview.vue'
const props = {
title: "Your Atelier points",
lead: "Every order earns you points. Spend them on vouchers or perks, or let them build up to the next tier.",
account: {
balance: 412,
lifetime: 920,
tier: "Silver",
expiring: {
points: 60,
date: "December 31, 2026"
},
since: "March 2025"
},
unit: "points",
tiers: [
{
name: "Bronze",
threshold: 0,
perks: [
"1 point per dollar spent",
"A gift on your birthday"
]
},
{
name: "Silver",
threshold: 500,
perks: [
"1.5 points per dollar spent",
"Free returns"
]
}
],
history: [
{
id: "h1",
date: "October 2, 2026",
label: "Order #1042",
points: 86,
kind: "earned",
balanceAfter: 412
},
{
id: "h2",
date: "September 18, 2026",
label: "$10 voucher redeemed",
points: -200,
kind: "spent",
balanceAfter: 326
}
],
rules: [
{
label: "1 point per dollar spent",
text: "Based on the order amount before shipping, once the order ships."
},
{
label: "Points last 12 months",
text: "We’ll send you a reminder before they expire."
}
],
terms: {
label: "Program terms",
action: "loyalty-terms"
}
}
</script>
<template>
<StorefrontLoyaltyPointsOverview v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe programme, said plainly ("Your Atelier points") |
| lead | string | Wordswhat the points are for, in the merchant’s words |
| account* | Account | Datathe signed-in customer’s own points, from the programme’s records |
| unit | string | Wordsthe unit, plural ("points", "seeds") |
| tiers | Tier[] | the merchant’s own tiers, in ascending order |
| history | History[] | Datathe points earned and spent |
| rules | Rule[] | the programme’s real rules, never invented |
| terms | Terms | the programme’s terms |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Account account · 5 props
| Prop | Type | Description |
|---|---|---|
| balance* | number | the points the customer can spend now |
| lifetime | number | the points earned since joining; tiers are reached on this figure |
| tier | string | the tier the customer holds, named as in `tiers` |
| expiring | Expiring | points that expire, with the date the programme writes |
| since | string | since when the customer is a member, as the programme writes it |
Expiring account.expiring · 2 props
| Prop | Type | Description |
|---|---|---|
| points* | number | how many points expire |
| date* | string | when they expire, as the programme writes it |
Tier tiers[] · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe tier ("Silver") |
| threshold* | number | the points earned in all that open it; 0 for the first |
| perks* | string[] | Wordswhat it unlocks |
History history[] · 6 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Datathe history entry’s id |
| date* | string | Wordsthe date as the programme writes it |
| label* | string | Wordswhat earned or spent the points ("Order no. 1042") |
| points* | number | positive: earned; negative: spent or expired |
| kind | 'earned' | 'spent' | 'expired' | 'adjusted' | what kind of history entry it is: earned, spent, expired, adjusted |
| balanceAfter | number | the balance after this entry |
Rule rules[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordshow points are earned ("1 point per euro spent") |
| text | string | Wordsthe rule’s text |
Terms terms · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
terms - Reads
loyaltyfrom your app
A storefront section, for account pages; it uses @lucide/vue.
More storefront blocks
- Lookbook campaign strip: three portrait pictures, the middle one raised and taller, a link centered under: a campaign in a glance.
- Lookbook cover wide cover: a wide cover picture under the title and two buttons, a strip of credits below: the opening of a season’s lookbook.
- Lookbook cover: the first frame as a wide magazine cover with the title and the link on its foot, the other frames as a numbered contact sheet with their captions and notes: a full shoot with one picture strong enough to open it.
- Lookbook pinboard: taped prints slightly rotated on a board that straighten under the pointer, with their caption and note: a casual, handmade lookbook or team picks.
- Made to order offer ledger: a product made after the order: when it is made and shipped, the queue, and a button that says when it is charged.
- Material shelf detail split: the list on one side, the chosen material large on the other: three to six materials with long copy.
- Material shelf glossary link: each material a row leading to its own entry page: a shop with an ingredients library.
- Material shelf grid: three or four columns, a round photo, the name and one line each: a brand page that lists its materials.