Comparison us vs them — Pricing block
Freepricing-comparison-us-vs-them · for landing, app pages
Comparison us vs them
Two columns, the usual terms against the merchant’s, in words: a shop publishing its conditions
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-comparison-us-vs-themUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import PricingComparisonUsVsThem from '@/components/trame/blocks/pricing/pricing-comparison-us-vs-them.vue'
const props = {
eyebrow: "Compare plans",
title: "Everything each plan includes",
lead: "The same rows for every plan, no asterisks.",
columns: [
{
key: "essentiel",
label: "Essential",
price: "$0 / month",
action: {
label: "Get started",
action: "signup",
record: {
id: "essentiel"
}
}
},
{
key: "pro",
label: "Pro",
price: "$29 / month",
note: "Billed monthly",
highlighted: true,
action: {
label: "Choose Pro",
action: "signup",
record: {
id: "pro"
}
}
}
],
groups: [
{
title: "Store",
rows: [
{
label: "Products",
values: {
essentiel: "50",
pro: "1,000",
atelier: "Unlimited"
}
},
{
label: "Custom domain",
hint: "Your own address instead of a subdomain",
values: {
essentiel: false,
pro: true,
atelier: true
}
}
]
},
{
title: "Shipping and returns",
rows: [
{
label: "Return labels",
values: {
essentiel: false,
pro: true,
atelier: true
}
},
{
label: "Connected carriers",
values: {
essentiel: "1",
pro: "3",
atelier: "6"
}
}
]
}
],
footnote: "Prices exclude sales tax, as checked by the team on the date of publication."
}
</script>
<template>
<PricingComparisonUsVsThem 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 ("Compare the offers") |
| title* | string | Wordsthe section’s title, in a few words ("Everything each offer includes") |
| lead | string | Wordsone or two sentences under the title |
| columns* | Column[] | the columns shown, in order |
| groups* | Group[] | the groups shown, in order |
| footnote | string | Wordswhere the figures come from and their date, as the merchant wrote it |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Column columns[] · 6 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe column’s key, the one used in each row’s values ("essential", "pro") |
| label* | string | Wordsthe offer’s name ("Pro") |
| price | string | Wordsits price as the merchant writes it ("€29 / month", "On quote") |
| note | string | Wordsa short line under the price, as the merchant wrote it |
| highlighted | boolean | true: the column the merchant recommends, set apart |
| action | Action | the column’s call to action: its words and the page action |
Action columns[].action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Choose Pro") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Group groups[] · 2 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe group’s name ("Delivery", "Support") |
| rows* | Row[] | the group’s rows, in order |
Row groups[].rows[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe feature or term ("Free returns") |
| hint | string | Wordsone line explaining it, when the label is not enough |
| values* | Record<string, boolean | string> | the value of each column by its key: true is a tick, false or absent a dash, a string its words |
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 |
| 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
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
columns[].action
A pricing section, for landing, app pages; it uses @lucide/vue, 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 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.
- Billing estimator cards: two billing periods side by side with the computed difference: monthly against annual — the merchant’s own only.
- Cost ledger: price transparency: line items adding up to a bold total; the merchant’s own only.
- Offer matrix table: the full grid of offers against features, ticks and short values, for visitors who compare line by line — the merchant’s own only.
- Plans carousel: four to six offers on a page with little width to spare: one plan card centred in full, its neighbours set back at each side, arrows and dots under; the highlighted offer opens first.
- Plans columns: 2 to 4 offers of similar weight side by side, the highlighted one raised: the usual comparison.
- Plans compact list: a single offer or membership: a big price, its inclusions as a tick list, one action.
- Plans duo: exactly 2 offers (free and paid, one-off and subscription): two large panels, the price very large.