Billing estimator cards — Pricing block

Pro

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

Usage

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.

PropTypeDescription
eyebrowstringWordswhat this is ("Simulator")
title*stringWordsthe section’s title ("Estimate your price")
leadstringWordsone or two sentences under the title
inputs*Input[]what the visitor sets, one to five inputs
model*Modelthe merchant’s rates the total is computed from
resultLabel*stringWordswhat the total is ("Your estimated price")
assumption*stringWordsthe assumption behind the figure, as the merchant states it ("Prices excl. tax, no discount, monthly commitment")
quoteLabelstringWordswhat 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"
actionActionthe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Input inputs[] · 11 props
PropTypeDescription
key*stringDesignthe input’s key, the one the model’s lines refer to
label*stringWordswhat the visitor sets ("Users")
kind*'slider' | 'stepper' | 'switch' | 'choice'slider: a range; stepper: a count; switch: on or off; choice: one of the options
minnumberDatathe lowest value
maxnumberDatathe highest value
stepnumberDatathe step between values
default*numberDatathe value shown first, and used by the server render
unitstringWordswhat the value counts ("orders / month")
hintstringWordsone line helping to answer
quoteFromnumberDatafrom this value the merchant quotes by hand: no total is shown
optionsOption[]the choices, for kind choice
Option inputs[].options[] · 2 props
PropTypeDescription
label*stringWordsthe choice’s words ("500")
value*numberDatathe units this choice stands for
Model model · 2 props
PropTypeDescription
basenumberDataa 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
PropTypeDescription
input*stringDesignthe key of the input that gives the units of this line
label*stringWordswhat the line charges for ("Additional users")
ratenumberDatacents per unit beyond the included units; a switch counts as one unit when on
includedUnitsnumberDataunits included before the rate applies
bandsBand[]graduated bands instead of a single rate, in order
Band model.lines[].bands[] · 3 props
PropTypeDescription
upTo*number | nullDatathe last unit of the band; null for the open last band
rate*numberDatacents per unit inside the band
labelstringWordsthe merchant’s name for the band ("Growth")
Period periods[] · 5 props
PropTypeDescription
key*stringDesignthe period’s key
label*stringWordsthe period ("Monthly", "Yearly")
unit*stringWordswhat the amount is per ("/ month")
factor*numberDatathe multiplier the merchant applies to the total for this period (1 for the base, 0.8 for a 20 % reduction)
notestringWordshow it is billed, as the merchant wrote it ("billed 12 months ahead")
Action action · 3 props
PropTypeDescription
label*stringWordswhat happens ("Start with this plan")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any; the chosen values are added to it
Options options · 2 props
PropTypeDescription
currencystringDesignISO 4217, the shop’s 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
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: 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.

All 32 pricing blocks