Comparison list — Pricing block

Free

pricing-comparison-list · for landing, app pages

Comparison list

One offer and its terms as a definition list, for a single supplied offer; 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-comparison-list

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import PricingComparisonList from '@/components/trame/blocks/pricing/pricing-comparison-list.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>
<PricingComparisonList v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
eyebrowstringWordswhat this is ("Compare the offers")
title*stringWordsthe section’s title, in a few words ("Everything each offer includes")
leadstringWordsone or two sentences under the title
columns*Column[]the columns shown, in order
groups*Group[]the groups shown, in order
footnotestringWordswhere the figures come from and their date, as the merchant wrote it
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Column columns[] · 6 props
PropTypeDescription
key*stringDesignthe column’s key, the one used in each row’s values ("essential", "pro")
label*stringWordsthe offer’s name ("Pro")
pricestringWordsits price as the merchant writes it ("€29 / month", "On quote")
notestringWordsa short line under the price, as the merchant wrote it
highlightedbooleantrue: the column the merchant recommends, set apart
actionActionthe column’s call to action: its words and the page action
Action columns[].action · 3 props
PropTypeDescription
label*stringWordswhat happens ("Choose Pro")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Group groups[] · 2 props
PropTypeDescription
title*stringWordsthe group’s name ("Delivery", "Support")
rows*Row[]the group’s rows, in order
Row groups[].rows[] · 3 props
PropTypeDescription
label*stringWordsthe feature or term ("Free returns")
hintstringWordsone 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
PropTypeDescription
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
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
  • 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 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.
  • 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.

All 32 pricing blocks