Points ledger table — Storefront block

Pro

storefront-points-ledger-table · for account pages

Points ledger table

The customer wants to check a number: the full ledger of points earned and spent, with the balance after each line.

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-points-ledger-table

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontPointsLedgerTable from '@/components/trame/blocks/storefront/storefront-points-ledger-table.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
}
],
terms: {
label: "Program terms",
action: "loyalty-terms"
}
}
</script>

<template>
<StorefrontPointsLedgerTable v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe programme, said plainly ("Your Atelier points")
leadstringWordswhat the points are for, in the merchant’s words
account*AccountDatathe signed-in customer’s own points, from the programme’s records
unitstringWordsthe unit, plural ("points", "seeds")
tiersTier[]the merchant’s own tiers, in ascending order
history*History[]Datathe points earned and spent
termsTermsthe programme’s terms
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Account account · 5 props
PropTypeDescription
balance*numberthe points the customer can spend now
lifetimenumberthe points earned since joining; tiers are reached on this figure
tierstringthe tier the customer holds, named as in `tiers`
expiringExpiringpoints that expire, with the date the programme writes
sincestringsince when the customer is a member, as the programme writes it
Expiring account.expiring · 2 props
PropTypeDescription
points*numberhow many points expire
date*stringwhen they expire, as the programme writes it
Tier tiers[] · 3 props
PropTypeDescription
name*stringWordsthe tier ("Silver")
threshold*numberthe points earned in all that open it; 0 for the first
perks*string[]Wordswhat it unlocks
History history[] · 6 props
PropTypeDescription
id*stringDatathe history entry’s id
date*stringWordsthe date as the programme writes it
label*stringWordswhat earned or spent the points ("Order no. 1042")
points*numberpositive: earned; negative: spent or expired
kind'earned' | 'spent' | 'expired' | 'adjusted'what kind of history entry it is: earned, spent, expired, adjusted
balanceAfternumberthe balance after this entry
Terms terms · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "See the collection"
actionstringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
urlstringDesignan address outside the app
Options options · 1 props
PropTypeDescription
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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 loyalty from your app

A storefront section, for account pages; it uses @lucide/vue.

More storefront blocks

  • Payment recovery inline banner: a compact banner above the payment form when recovery happens in place: it takes the focus so the message is read.
  • Payment retry facts list: a payment that did not go through: the facts of the attempt, what happens next, retry or change the method.
  • Payment trust line: directly under the pay button: one plain sentence and the accepted methods as chips.
  • Pickup picker points: relay points, lockers or shops: a home or pickup tab and a list of points with distance and hours.
  • Points rewards affordable first: The customer has points to spend: the rewards to redeem, those they can afford first, the balance always in view.
  • Preorder banner: a pre-order announced between two sections or above a product page: the picture, the date, what is paid now, one button.
  • Preorder product split: the pre-order is the page’s subject: a large picture beside the date, the two payments side by side and the terms.
  • Preorder products cards: a ship window, a reserved-of-total meter and a reserve button: a limited run in preorder; the merchant’s own products and figures only.

All 409 storefront blocks