Declaring blocks
schema.json
string
required
Block type, unique in the section.
string
required
Name shown in the editor.
number
Most blocks of this type in one section.
Setting[]
required
Same setting types as sections. See Section schema.
max_blocks on the section caps all block types together.
Blocks in templates
templates/index.json
"disabled": true stays in the file but does not render.
Nested blocks
Set"nested_blocks": true on a section to let a block sit one level under another block. Menus with dropdowns are the common case.
In Visual, drag a block to the right to nest it under the block above, and to the left to take it out.
In the template, a child block names its parent’s id:
groups/header.json
Reading nested blocks
Every block hasparent (the parent’s id, or null at the top level) and children (its enabled child blocks, in order).
- React
- Liquid
- Vite
index.tsx
blocks still lists every enabled block, children included. Use rootBlocks (React, Vite) or root_blocks (Liquid) when you render a tree, so children are not drawn twice.
