Savings calculator stacked — Pricing block
Propricing-savings-calculator-stacked · for landing, home, pricing pages
Savings calculator stacked
The two questions side by side above a dark band that writes the sum as one line (volume × cost − fee = net): a page that wants the arithmetic itself to be the argument, in a narrower column.
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-savings-calculator-stackedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import PricingSavingsCalculatorStacked from '@/components/trame/blocks/pricing/pricing-savings-calculator-stacked.vue'
const props = {
eyebrow: "Savings calculator",
title: "See what automated reporting gives back every month",
intro: "Tell us how many reports your team assembles by hand and what one costs you. We do the arithmetic with our real price.",
volume: {
question: "How many client reports does your team build each week?",
unit: "reports",
unitOne: "report",
min: 1,
max: 60,
step: 1,
default: 10,
period: "week"
},
unitCost: {
question: "What does one report cost you today?",
default: 4500
},
fee: {
label: "Pro plan",
amount: 14900,
period: "month"
},
action: {
label: "Start your free trial",
action: "signup"
}
}
</script>
<template>
<PricingSavingsCalculatorStacked v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordswhat this is ("Savings calculator") |
| title* | string | Wordsthe section’s title ("See what you save every month") |
| intro | string | Wordsone or two sentences under the title |
| volume* | Volume | the question on how many units the visitor handles |
| unitCost* | UnitCost | the question on what one unit costs the visitor today |
| fee* | Fee | the merchant’s plan and its price |
| formula | string | Wordsthe rule in words under the breakdown, as the merchant writes it; a sentence built from the labels when absent |
| action | Action | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Volume volume · 8 props
| Prop | Type | Description |
|---|---|---|
| question* | string | Wordswhat the visitor is asked ("How many reports do you build by hand?") |
| unit* | string | Wordswhat the volume counts, plural ("reports") |
| unitOne | string | Wordsthe same word for one ("report"); the plural when absent |
| min* | number | Datathe lowest volume on the slider |
| max* | number | Datathe highest volume on the slider |
| step | number | Datathe step between volumes; 1 when absent |
| default* | number | Datathe volume shown first, and used by the server render |
| period* | 'week' | 'month' | the volume is counted per week (× 4.33 for a month) or per month |
UnitCost unitCost · 3 props
| Prop | Type | Description |
|---|---|---|
| question* | string | Wordswhat the visitor is asked ("What does one report cost you today?") |
| default* | number | Datathe cost of one unit shown first, in cents of the app’s currency |
| editable | boolean | false: the cost is the merchant’s stated figure, shown but not changed; editable by default |
Fee fee · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe merchant’s plan, as the breakdown names it ("Pro plan") |
| amount* | number | Datathe plan’s real price, in cents: the merchant’s own only |
| period | 'month' | the fee is a monthly price |
Action action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Try for free") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| 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 |
| money | formats a price, given in cents |
| 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:
action
A pricing section, for landing, home, pricing pages; it uses @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More pricing blocks
- Plans with enterprise strip: 3 priced offers plus a slim strip for the one on request, so the grid never mixes a price and no price.
- Price calculator curve: the price headline beside the rate curve with the visitor’s point on it: volume pricing — the merchant’s own only.
- Price calculator receipt: the inputs beside an itemised receipt with a large total: an offer priced from several quantities — the merchant’s own only.
- Price calculator slider plan: one slider mapped to the merchant’s bands, a compact card naming the band reached: usage-based tiers.
- Ticket tiers cards: tiers as cards that say what each includes: fares that differ by more than their price (VIP, pass, workshop).
- Ticket tiers list: a few tiers read as rows, a stepper on each: a concert or a talk with plain full, reduced and group fares.
- Trial offer split: Steps beside the exact offer and terms supplied by the merchant; the merchant’s own only.; the merchant’s own only.
- Trial timeline horizontal: A short reassurance journey across a line, vertical on phones; the merchant’s own only.; the merchant’s own only.