Pricing blocks for Payload CMS
Pricing blocks turn plans and packages into something a visitor can compare, and Tome has four: Pricing, Price Table, Grants Ledger and Campaign Tiers. Pricing is free, and all four install into the Payload project you already have.
Add one to your Payload project
You need a Payload 3 and Next.js app, a free account and an install token. The get-started guide covers the token and the .npmrc lines.
Pricing is in the free Marketing Starter pack. Paid packs install the same way once your token covers them.
Install the pack
npm install @wabbit/tome-blocks-marketing-starterLoad the design tokens
One line in your global CSS. Without it the blocks render unstyled.
@import '@wabbit/tome-blocks-core/styles.css';Add the block to a field
Put it in your Pages collection's blocks field, next to the blocks you already have. Run
payload generate:typesafterwards so your generated types know about the new block.import { pricingBlock } from '@wabbit/tome-blocks-marketing-starter' // in your Pages collection: { name: 'layout', type: 'blocks', blocks: [...existingBlocks, pricingBlock.block()], }Render it on the Tome grid
import { renderers } from '@wabbit/tome-blocks-marketing-starter/render/register' import { adaptRenderersForPayload, RenderBlocks } from '@wabbit/tome-blocks-core/render' import gridStyles from '@wabbit/tome-ui/grid' const blockComponents = { ...yourExistingComponents, ...adaptRenderersForPayload(renderers), } <RenderBlocks blocks={page.layout} components={blockComponents} gridClassName={gridStyles.grid} />
Only if the project has never installed from our registry
Sign up at /signup (no card). Then go to Account, Credentials, claim the free license and generate your key in the same card. Add this to the project's .npmrc:
@wabbit:registry=https://npm.wabbit.com/And this to your user-level ~/.npmrc:
//npm.wabbit.com/:_authToken=YOUR_TOKEN_HEREQuestions about pricing blocks
- Can I show subscription and one-time prices together?
- Yes. Pricing, the free block in Marketing Starter, lays out subscription and project cards with an optional toggle between the two. You enter the cards on the block or draw them from a card collection your site names, and four variants run from a full-width grid to a minimal price list.
- Which block compares tiers feature by feature?
- Price Table, in Commerce Blocks, shows up to five tiers side by side, each with a price, a billing note, a feature checklist, a recommended flag and its own CTA. Grants Ledger, in Dossier Blocks, is a real table with one column per plan and one row per feature, and one column can be inverted to read as a different kind of plan.
- Do the pricing blocks need a store behind them?
- Price Table and Campaign Tiers are fully authored, so you type in the tiers and they need no catalog or commerce collection. Pricing takes its cards from the block itself or from a card collection your site names.
- Is there a block for a crowdfunding or pre-order page?
- Campaign Tiers, in Campaign Blocks, shows 2 to 4 reward tiers as a wall of cards or as stacked numbered rows. Each tier has a price label, a description, feature bullets, its own link and an optional recommended flag.
Start with the free packs.
Create a free account, generate an install token, and add a pack to the Payload project you already have. There is no card and no trial.
The Craft Library is $250 a year and adds every paid pack with full source. If you stop, what you installed stays yours.
- Free: Marketing Starter and Content Writer, 19 blocks, no card.
- Craft Library, $250 a year: every paid pack and theme, full source, scoped install tokens.
- Single packs, $49 once: for the packs sold on their own.