Price routes two ledgers — Storefront block

Pro

storefront-price-routes-two-ledgers · for product, home, landing, story pages

Price routes two ledgers

Two short ledgers, the usual route against selling direct, ending in two totals: a brand selling direct

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-price-routes-two-ledgers

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontPriceRoutesTwoLedgers from '@/components/trame/blocks/storefront/storefront-price-routes-two-ledgers.vue'

const props = {
eyebrow: "Transparence",
title: "Why this bag costs $89",
lead: "Every dollar, from the leather to our margin. The figures are from the latest production run.",
total: 8900,
ledgerTitle: "Direct, from us",
lines: [
{
label: "Full-grain leather",
amount: 2400,
note: "Tanned in the USA, certified chrome-free."
},
{
label: "Workshop labor",
amount: 3100,
note: "Four hours of work, paid above the industry minimum."
}
],
compare: {
title: "At a retailer",
total: 17800,
lines: [
{
label: "Making",
amount: 5500
},
{
label: "Distribution and shipping",
amount: 3300
}
]
},
stats: [
{
value: "4 h",
caption: "of workshop labor per bag"
},
{
value: "$14",
caption: "an hour, benefits included, paid to the workshop"
}
],
closing: "If a figure looks wrong to you, write to us: we answer.",
footnote: "March run; all prices include tax."
}
</script>

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

Props

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

PropTypeDescription
eyebrowstringWordswhat this is ("Transparency")
title*stringWordsthe section’s title ("Why this bag costs €89")
leadstringWordsone or two sentences under the title
total*numberDatathe price the lines explain, in cents, as the merchant set it
ledgerTitlestringWordsthe name of the main column when two are compared ("Live")
lines*Line[]what the price is made of, line by line
compare*Comparethe other route to compare with, e.g. "At a reseller"
statsStat[]the stats shown, in order
closingstringWordsa closing sentence, as the merchant wrote it
footnotestringWordswhere the figures come from and their date
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Line lines[] · 3 props
PropTypeDescription
label*stringWordswhere the money goes ("Raw materials")
amount*numberDatathe merchant’s own amount for this line, in cents
notestringWordsone line saying what it covers
Compare compare · 3 props
PropTypeDescription
title*stringWordswhat the other route is ("At a reseller")
total*numberDataits price in cents, from the merchant’s own sourced figures
lines*Line[]the other route’s cost lines
Line compare.lines[] · 3 props
PropTypeDescription
label*stringWordswhere the money goes ("Raw materials")
amount*numberDatathe merchant’s own amount for this line, in cents
notestringWordsone line saying what it covers
Stat stats[] · 2 props
PropTypeDescription
value*stringWordsthe figure as the merchant writes it ("€14 / h")
caption*stringWordswhat it measures
Options options · 3 props
PropTypeDescription
currencystringDesignISO 4217, the shop’s by default
showBarsbooleanfalse: hides the bars beside the figures
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
moneyformats a price, given in cents
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

A storefront section, for product, home, landing, story pages; it uses clsx, motion, tailwind-merge.

More storefront blocks

  • 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.
  • Preorder timeline steps: when the payment plan is the doubt (a deposit, a balance at shipping): the product small above, each step of the order drawn with its date and amount.
  • Price breakdown ruled bars: a ruled ledger, each line with its amount and a thin bar of its weight: the honest account of one price.
  • Price breakdown stacked bar: one segmented bar and its legend: 3 to 6 lines read at a glance.
  • Price story figures: a short account, three or four key figures and a closing sentence, no ledger: reasons that are not only cost.
  • Product close ups film: tall close-ups in a row that scrolls sideways, each name over its foot, the piece leading the row as its first card: a product page band that shows the making quality without a long read.
  • Product close ups index: a numbered list of the details beside one large close-up that changes as a detail is chosen, the piece’s card under the list: a few details with real explanations, read one at a time.
  • Product close ups loupes: each detail in a round close-up like a magnifying glass, set in staggered balanced rows with its name and note under it, the piece itself in a card at the head: three to twelve details of a crafted piece (leather, knitwear, ceramics).

All 409 storefront blocks