# Block library — ready page sections and page templates
Fifteen standard page sections (Payload block + React server component) and ten page templates,
so every site is assembled from the same parts. Each block is made of the plugin's building blocks
(`buildSectionHeaderField`, `buildLinksField`, `RenderForm`, `LightboxTrigger`, `RenderRichText`…),
has an editor panel in English and Polish (docs/dev/admin-ux.md), meets the accessibility rules below,
and is styled **only with the design-token utilities** (`bg-surface`, `text-fg`, `py-section`…).
Nothing is on by default. The project turns on the blocks it wants, and can change, swap or eject any
of them, or keep its own blocks in the same layout (CLAUDE.md main rule).
| Entry | What | Imported by |
|---|---|---|
| `@intecion/ipal-kit/blocks` | block configs, field builders, the manifest — no React | `payload.config`, collections |
| `@intecion/ipal-kit/blocks/rsc` | block components, UI primitives, `createBlockRegistry` | `src/blocks/registry.ts` |
| `@intecion/ipal-kit/templates` | page templates (seed data) | seed scripts only |
## Setup (a new site)
**1. Turn the blocks on in the Pages layout:**
```ts
// src/blocks/configs.ts — imported by src/collections/Pages.ts
import { libraryBlocks, type LibraryBlocksOptions } from '@intecion/ipal-kit/blocks'
export const blockOptions = {
hero: true, textMedia: true, featureGrid: true, cta: true, richText: true, faq: true, contact: true, gallery: true,
} satisfies LibraryBlocksOptions
export const pageBlocks = [
...libraryBlocks(blockOptions),
// the project's own blocks, e.g. TimelineBlock
]
// Pages.ts: { name: 'layout', type: 'blocks', blocks: pageBlocks }
```
The eight above are what every surveyed site built; add `testimonials`, `stats`, `steps`, `logos`, `team`,
`pricing`, `entryList` when the site map needs them. Fewer blocks = a shorter block picker for the editor.
**2. The registry** — every library block bound to lib/content, plus the project's own:
```ts
// src/blocks/registry.ts
import Image from 'next/image'
import Link from 'next/link'
import { createBlockRegistry } from '@intecion/ipal-kit/blocks/rsc'
import * as content from '@/lib/content'
import { sendForm } from '@/lib/sendForm'
import { formClasses } from '@/components/forms/formClasses'
export const blockRegistry = createBlockRegistry(content, {
Image, // next/image: optimized images with blur-up (without it: a plain
)
Link, // next/link: client-side navigation (without it: a plain )
sendForm, // the contact block's form action (createSubmitAction, docs/forms.md)
formClassNames: formClasses,
// contactDetails: async (locale) => [{ label: 'Phone', value: '+48 …', href: 'tel:+48…' }],
// extra: { timeline: TimelineBlock },
})
```
The plugin never imports `next/*` itself, so `Image` and `Link` are passed in. `createPageRoute(content, { blocks: blockRegistry, … })`
or `` renders them (docs/frontend.md, docs/blocks.md).
**3. Styles.** The components use the token utilities of the design-token preset, and Tailwind must scan the
plugin's files. The standard `styles.css` ([design-tokens.md](./design-tokens.md)) already does both:
```css
@import "tailwindcss";
@import "@intecion/ipal-kit/fluid-wide.css";
@import "@intecion/ipal-kit/tokens.css";
@import "@intecion/ipal-kit/tailwind.css";
@import "../../design/tokens.css";
@source "../../../node_modules/@intecion/ipal-kit/dist/**/*.js";
```
**4. Also wire:** `` in the layout (gallery images open in the viewer, docs/lightbox.md) and
FAQ rich results: `getPageJsonLd(locale, slug, { faq: faqItemsFromLayout })` (docs/seo.md). For your own
`seo` pass-through: `faqItemsFromLayout(doc, { slugs: ['faq'] })`.
**5. Then:** `pnpm generate:types` · `pnpm payload generate:importmap` (the blocks use the plugin's row-label
component) · Postgres/SQLite: `pnpm payload migrate:create` and commit the migration (MongoDB needs none).
**Verify:** the block picker shows the blocks in the editor's language; adding each block shows at most six
fields; a page with every block renders (`pnpm build`); every section has `data-ipal-block=""` in the HTML; only the
first section's heading is `h1`; the gallery opens images in the viewer; `iapl-doctor` / `iapl-audit` report no block errors.
## The blocks
Every block has, in panel order: `header` (eyebrow, heading, intro) → its own fields → `links` (buttons, where the
block has them) → `variant` (sidebar) → `settings` (sidebar: anchor, background). Field names follow AGENT.md §6.5.
| Slug (builder) | Panel name | Own fields | Variants | Accessibility |
|---|---|---|---|---|
| `hero` (`buildHeroBlock`) | Hero / `Sekcja główna` | `media` (image or video), `poster` | `split`, `background`, `centered`, `page` | the first section's heading is the page `h1`; its image is the LCP image (eager, high priority); a background image is decorative (`alt=""`) under a full `bg-overlay` scrim (raise `--ipal-overlay` for very light photos) |
| `textMedia` (`buildTextMediaBlock`) | Text and image | `content` (rich text), `media` | `mediaRight`, `mediaLeft` | reading order = text first on every screen |
| `featureGrid` (`buildFeatureGridBlock`) | Feature grid | `items[]`: `icon` (with `icons`), `media`, `heading`, `text`, `link`; `columns` | `cards`, `list`, `numbered` | a linked feature: its heading is the link and covers the card; a dead link leaves plain text |
| `gallery` (`buildGalleryBlock`) | Gallery | `items[]`: `media`, `caption`; `columns` | `grid`, `masonry` | each image a `LightboxTrigger` (keyboard, focus return, labels from Form messages); captions in `` |
| `faq` (`buildFaqBlock`) | FAQ | `items[]`: `question`, `answer` | `single`, `twoColumn` | native ``/``, works without script |
| `cta` (`buildCtaBlock`) | Call to action | `media` | `band`, `card`, `split` | renders nothing without a heading and buttons |
| `contact` (`buildContactBlock`) | Contact | `form` (relation), `content` | `formWithDetails`, `formOnly` | `RenderForm` (labels, errors, consent); details as ``; the spam check widget turns dark in an inverted section |
| `team` (`buildTeamBlock`) | Team | `items[]`: `media`, `heading` (name), `text` (role), `bio`, `link` | `grid`, `list` | the name is the profile link |
| `pricing` (`buildPricingBlock`) | Pricing | `items[]`: `heading`, `price`, `period`, `text`, `features[]`, `highlighted`, `link`; `highlightLabel`, `note` | — | the highlighted plan carries a text label, not only a colour |
| `logos` (`buildLogosBlock`) | Logos | `items[]`: `media`, `heading` (name), `link` | `row`, `grid` | the name is the alt text when the image has none; no marquee |
| `testimonials` (`buildTestimonialsBlock`) | Testimonials | `items[]`: `quote`, `heading` (author), `text`, `media`, `rating`; with `collection`: `source`, `entries` | `grid`, `single` | `` + `` + ``; stars hidden, rating read as text |
| `stats` (`buildStatsBlock`) | Key figures / `Liczby` | `items[]`: `value`, `heading` (label), `text` | `row`, `cards` | a ``; static (no count-up animation) |
| `richText` (`buildRichTextBlock`) | Text | `content`, `tableOfContents` | `narrow`, `wide` | heading anchors + table of contents (`aria-current` on the section being read) |
| `steps` (`buildStepsBlock`) | Steps | `items[]`: `heading`, `text`, `media` | `numbered`, `timeline` | an ``; the number read as "Step 1" |
| `entryList` (`buildEntryListBlock`) | Entry list | `entryCollection`, `mode` (latest / chosen), `limit`, `entries` | `cards`, `list` | each title links to its entry and covers the card; dates in `