Overview
Every section on this site, from the hero to the footer, is a block in the page editor. A block is a React component whose text, links and images live in its props, so editors can change them without touching code.
The server stores only blocks it knows by name and checks every link and image in their props before it saves a page.
Name it
Add the block's name to siteBlockNames in packages/contracts/src/site.ts. The API refuses a page that uses a name missing from this list.
Write the component
Create the component in apps/web/src/features/site/blocks and wrap it with defineBlock. Render text with EText, links with ELink and images with EImage, each pointing at a prop by its path, and list the fields the Style panel shows for it.
Lay it out with the page container's breakpoints, @max-[1280px]/page and @max-[810px]/page, so it follows the editor's tablet and phone frames as well as the browser.
- Add the name to siteBlockNames
- Write the component with defineBlock
- Register it in the blocks' index.ts
- Give it starting content in a template page
Register it
Add the block to the index.ts beside it so the editor and the public renderer can resolve it. The Insert tab starts a new block with the content it has in the site template, so add it to a page in packages/contracts/src/site-template as well.
Install the template again from Admin, Pages. Pages you have already edited keep your changes.
0
Places to change: the name, the component, the index and the template.
0
Frames to check it in: desktop, tablet and phone.
0
Blocks a single page can hold before the server refuses to save it.






