Cost ledger — Pricing block
Propricing-cost-ledger · for home, product, cart, checkout, landing pages
Cost ledger
Price transparency: line items adding up to a bold total; the merchant’s own only
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/pricing-cost-ledgerUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import PricingCostLedger from '@/components/trame/blocks/pricing/pricing-cost-ledger.vue'
const props = {
title: "Where our price comes from",
lead: "What you can expect from us, written plainly.",
facts: [
{
label: "Materials",
text: "Combed wool, cotton lining",
value: "$38"
},
{
label: "Making",
text: "Partner workshop, wages included",
value: "$46"
}
],
link: {
label: "Read the full terms",
action: "page.terms"
},
total: {
label: "Shop price",
value: "$134"
}
}
</script>
<template>
<PricingCostLedger v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe promise or the rule, plainly ("Free returns within 30 days") |
| lead | string | Wordsone or two sentences of context |
| facts* | Fact[] | the facts shown, in order |
| total* | Total | the sum: its name and its value |
| footnote | string | Wordsa limit or an exception, as the merchant states it |
| link | Link | the link: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Fact facts[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe term ("Lead time") |
| text* | string | Wordswhat it means, as the merchant states it |
| icon | string | Designshield | truck | rotate | card | package | clock | gift | percent | leaf | check |
| value | string | Wordsthe amount or duration when there is one ("30 days", "€4.90") |
Total total · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe sum’s name ("Total paid") |
| value* | string | Wordsthe sum, as the merchant states it |
Link link · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words ("Read the full terms") |
| 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 |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short line above the title |
| 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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
link
A pricing section, for home, product, cart, checkout, landing pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More pricing blocks
- Comparison list: One offer and its terms as a definition list, for a single supplied offer; the merchant’s own only.
- Comparison per offer: one folded list per offer showing only what it includes: phone-first, good from four offers — the merchant’s own only.
- Comparison service levels: one card per service tier listing its commitments (delay, channel, contact): support or care plans — the merchant’s own only.
- Comparison us vs them: two columns, the usual terms against the merchant’s, in words: a shop publishing its conditions.
- Offer matrix table: the full grid of offers against features, ticks and short values, for visitors who compare line by line — the merchant’s own only.
- Plans carousel: four to six offers on a page with little width to spare: one plan card centred in full, its neighbours set back at each side, arrows and dots under; the highlighted offer opens first.
- Plans columns: 2 to 4 offers of similar weight side by side, the highlighted one raised: the usual comparison.
- Plans compact list: a single offer or membership: a big price, its inclusions as a tick list, one action.