Price calculator slider plan — Pricing block
Propricing-price-calculator-slider-plan · for landing, app, product pages
Price calculator slider plan
One slider mapped to the merchant’s bands, a compact card naming the band reached: usage-based tiers
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-price-calculator-slider-planUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import PricingPriceCalculatorSliderPlan from '@/components/trame/blocks/pricing/pricing-price-calculator-slider-plan.vue'
const props = {
eyebrow: "Estimator",
title: "Estimate your price in seconds",
lead: "Set your volumes: the calculation uses our exact price list, 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 subscription.",
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",
resultUnit: "/ month",
assumption: "Prices exclude tax, for a monthly plan, calculated with our current price list. Your bill may vary if your volumes change.",
action: {
label: "Start with this plan",
action: "signup",
record: {
id: "custom"
}
}
}
</script>
<template>
<PricingPriceCalculatorSliderPlan 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") |
| resultUnit | string | Wordswhat the total is per ("/ month") |
| 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") |
| 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") |
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
- Plans stacked: 3 to 5 offers with long inclusion lists: one wide row per offer, price and action on the right.
- Plans title aside: one or two offers whose argument deserves as much room as the price: the title, lead, period switch and footnote in a sticky column at the left, each offer a wide card at the right with its inclusions in two columns.
- 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.
- Savings calculator ledger: one wide card, the visitor’s volume and cost on the left, a muted panel on the right with the net saving very large over its breakdown: a product whose price is easiest to justify by the work it replaces — the merchant’s own fee only.
- 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.
- 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.