Banner and notice blocks for Payload CMS
A banner or notice carries one short message without taking over the page, and Tome has three: Banner, Post Notice and Lexical Banner. Banner is free and covers site-wide announcements, and all three 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.
Banner 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 { bannerBlock } from '@wabbit/tome-blocks-marketing-starter' // in your Pages collection: { name: 'layout', type: 'blocks', blocks: [...existingBlocks, bannerBlock.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 banner and notice blocks
- What can the Banner block do?
- Banner, in the free Marketing Starter pack, is an announcement bar with a short title, a description and optional links. It can be styled as an info, warning, error or success alert, or as a quiet editorial aside, and one of its four variants is a sticky bar that stays as the visitor scrolls.
- Is there a notice for use inside a blog post?
- Post Notice, in Extras, is an inline callout with a type badge (info, warning, tip or deprecated) and a rich-text body, for alerts that don't break the reading flow.
- Can a banner go inside a rich text field?
- Lexical Banner, in Extras, is an inline banner and callout block written for Lexical richText editors.
- Is there a callout with a priority level?
- Message Panel, listed under Editorial Layout, renders one message at Info, Warning or Urgent priority, with optional source attribution, a category label, a timestamp and an image.
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.