Billing estimator cards — Pricing block
Propricing-billing-estimator-cards · for landing, app, product pages
Billing estimator cards
Two billing periods side by side with the computed difference: monthly against annual — 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-billing-estimator-cardsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import PricingBillingEstimatorCards from '@/components/trame/blocks/pricing/pricing-billing-estimator-cards.vue'
const props = {
eyebrow: "Estimator",
title: "Estimate your price in seconds",
lead: "Set your volumes: the math uses our exact rate card, with no hidden extras.",
inputs: [
{
key: "seats",
label: "Users",
kind: "stepper",
min: 1,
max: 50,
step: 1,
default: 5,
unit: "users",
hint: "Two are included in the plan.",
quoteFrom: 50
},
{
key: "orders",
label: "Orders per month",
kind: "slider",
min: 0,
max: 5000,
step: 100,
default: 1200,
unit: "orders"
}
],
model: {
base: 1900,
lines: [
{
input: "seats",
label: "Additional users",
rate: 800,
includedUnits: 2
},
{
input: "orders",
label: "Orders",
bands: [
{
upTo: 500,
rate: 0,
label: "Starter"
},
{
upTo: 2000,
rate: 4,
label: "Growth"
}
]
}
]
},
resultLabel: "Your estimated price",
assumption: "Prices before tax for a monthly plan, calculated with our current rate card. Your bill may vary if your volumes change.",
periods: [
{
key: "monthly",
label: "Monthly",
unit: "/ month",
factor: 1,
note: "No commitment"
},
{
key: "yearly",
label: "Yearly",
unit: "/ month",
factor: 0.8,
note: "Billed 12 months in advance"
}
],
action: {
label: "Start with this plan",
action: "signup",
record: {
id: "custom"
}
}
}
</script>
<template>
<PricingBillingEstimatorCards 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 ("Simulator") |
| title* | string | Wordsthe section’s title ("Estimate your price") |
| lead | string | Wordsone or two sentences under the title |
| inputs* | Input[] | what the visitor sets, one to five inputs |
| model* | Model | the merchant’s rates the total is computed from |
| resultLabel* | string | Wordswhat the total is ("Your estimated price") |
| assumption* | string | Wordsthe assumption behind the figure, as the merchant states it ("Prices excl. tax, no discount, monthly commitment") |
| quoteLabel | string | Wordswhat is shown instead of a total when a value reaches its quote threshold ("On quote") |
| periods* | Period[] | the billing periods to choose from, e.g. "Monthly" |
| 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 |
Input inputs[] · 11 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe input’s key, the one the model’s lines refer to |
| label* | string | Wordswhat the visitor sets ("Users") |
| kind* | 'slider' | 'stepper' | 'switch' | 'choice' | slider: a range; stepper: a count; switch: on or off; choice: one of the options |
| min | number | Datathe lowest value |
| max | number | Datathe highest value |
| step | number | Datathe step between values |
| default* | number | Datathe value shown first, and used by the server render |
| unit | string | Wordswhat the value counts ("orders / month") |
| hint | string | Wordsone line helping to answer |
| quoteFrom | number | Datafrom this value the merchant quotes by hand: no total is shown |
| options | Option[] | the choices, for kind choice |
Option inputs[].options[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe choice’s words ("500") |
| value* | number | Datathe units this choice stands for |
Model model · 2 props
| Prop | Type | Description |
|---|---|---|
| base | number | Dataa fixed amount in cents, whatever the inputs (the subscription, the minimum) |
| lines* | Line[] | what the price is made of: one line per input that counts |
Line model.lines[] · 5 props
| Prop | Type | Description |
|---|---|---|
| input* | string | Designthe key of the input that gives the units of this line |
| label* | string | Wordswhat the line charges for ("Additional users") |
| rate | number | Datacents per unit beyond the included units; a switch counts as one unit when on |
| includedUnits | number | Dataunits included before the rate applies |
| bands | Band[] | graduated bands instead of a single rate, in order |
Band model.lines[].bands[] · 3 props
| Prop | Type | Description |
|---|---|---|
| upTo* | number | null | Datathe last unit of the band; null for the open last band |
| rate* | number | Datacents per unit inside the band |
| label | string | Wordsthe merchant’s name for the band ("Growth") |
Period periods[] · 5 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe period’s key |
| label* | string | Wordsthe period ("Monthly", "Yearly") |
| unit* | string | Wordswhat the amount is per ("/ month") |
| factor* | number | Datathe multiplier the merchant applies to the total for this period (1 for the base, 0.8 for a 20 % reduction) |
| note | string | Wordshow it is billed, as the merchant wrote it ("billed 12 months ahead") |
Action action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Start with this plan") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any; the chosen values are added to it |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| currency | string | DesignISO 4217, the shop’s by default |
| 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, app, product pages; it uses @lucide/vue, @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
- Addons chips under plans: a slim band right under the plans, when the extras are a footnote to the offer: the title at the left, each extra a price pill that opens its sentence; the merchant’s own prices only.
- Addons featured and rows: a few extras that matter most and a tail of smaller ones: the first two or three as tinted cards, the rest as compact rows in the same frame; the merchant’s own prices only.
- Addons rows: three to nine extras told equally on a pricing page: one ruled row each in a single panel, the price and a small button at the end; the merchant’s own prices only.
- Comparison card columns: each offer as one tall card from its header to its action, ticks in soft circles: a lighter grid for few offers — the merchant’s own only.
- Comparison focus aside: the chosen offer pulled out as a card beside the grid of the others: highlight one without dropping the table — the merchant’s own only.
- 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.