Open books cost breakdown — Storefront block

Pro

storefront-open-books-cost-breakdown · for about, product, sustainability pages

Open books cost breakdown

Lines with their amount and a thin proportional bar, and the total: where the price of a product goes; 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/storefront-open-books-cost-breakdown

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontOpenBooksCostBreakdown from '@/components/trame/blocks/storefront/storefront-open-books-cost-breakdown.vue'

const props = {
title: "Where every dollar of a bag goes",
lead: "Here is the breakdown of a bag sold for $240 including tax, calculated from this year’s sales.",
rows: [
{
label: "Leather and supplies",
amount: 6200,
note: "Montana tannery, vegetable-tanned"
},
{
label: "Workshop: wages and payroll taxes",
amount: 8800
}
],
total: {
label: "Retail price incl. tax",
amount: 24000
},
source: "Workshop accounts, fiscal year 2025, reviewed by our CPA",
asOf: "As of December 31, 2025",
footnote: "Updated once a year, in January."
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe claim these books prove ("Where each euro of a bag goes")
leadstringWordswhat the figures cover and why the merchant publishes them
rows*Row[]Datathe merchant’s own lines: three at least
totalTotalDatathe whole the amounts add up to
source*stringWordswhere the figures come from ("Workshop accounts, 2025 financial year, certified by our accountant")
asOf*stringWordsthe date of the figures, as the merchant wrote it ("At 31 December 2025")
footnotestringWordshow often it is updated, or a limit of the figures
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Row rows[] · 6 props
PropTypeDescription
label*stringWordswhat the line counts ("Materials", "Workshop", "Shop margin")
amountnumberan amount in cents
sharenumberits share of the whole, in percent
valuestringWordsa figure that is not money, as the merchant writes it ("214 repairs", "3 rooms")
beforestringWordsthe same measure at the first date, for then-now ("41%")
notestringWordsone short line of explanation
Total total · 2 props
PropTypeDescription
label*stringWords("Retail price incl. VAT")
amount*numberin cents
Options options · 2 props
PropTypeDescription
currencystringDesignISO 4217, EUR by default
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 about, product, sustainability pages; it uses clsx, motion, tailwind-merge.

More storefront blocks

  • Offer popup slide in: A compact nonblocking card positioned by the host; the merchant's own offer only.
  • Offers panel drawer: a slim band naming the offers that opens a side sheet of picture rows, sides alternating: several offers worth a look without taking the page; the merchant’s own offers only.
  • Offers panel inline strip: the offers as a row of cards on the page, scrolling sideways past three: when no overlay is wanted; the merchant’s own offers only.
  • Offers panel launcher stack: a small pill fixed at the bottom corner with the count, opening a compact card of thumbnail rows: offers always at hand on a catalogue or cart page; the merchant’s own offers only.
  • Order confirmation card: one centred card with the order, its delivery and its actions: the default after a payment.
  • Order confirmation receipt: the order’s four facts side by side above its lines and totals: a customer who wants the record at a glance.
  • Order confirmation table: a bordered panel with the order’s header and a table of items: orders with many lines or a delivery date per line.
  • Order detail sheet: a side sheet over the order list, closed back to it: opening one order without leaving the history.

All 409 storefront blocks