Cost ledger — Pricing block

Pro

pricing-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-ledger

Usage

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.

PropTypeDescription
title*stringWordsthe promise or the rule, plainly ("Free returns within 30 days")
leadstringWordsone or two sentences of context
facts*Fact[]the facts shown, in order
total*Totalthe sum: its name and its value
footnotestringWordsa limit or an exception, as the merchant states it
linkLinkthe link: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Fact facts[] · 4 props
PropTypeDescription
label*stringWordsthe term ("Lead time")
text*stringWordswhat it means, as the merchant states it
iconstringDesignshield | truck | rotate | card | package | clock | gift | percent | leaf | check
valuestringWordsthe amount or duration when there is one ("30 days", "€4.90")
Total total · 2 props
PropTypeDescription
label*stringWordsthe sum’s name ("Total paid")
value*stringWordsthe sum, as the merchant states it
Link link · 3 props
PropTypeDescription
label*stringWordsthe link’s words ("Read the full terms")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
Options options · 2 props
PropTypeDescription
eyebrowstringWordsa short line above the title
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
  • 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.

All 32 pricing blocks