Skip to main content
A reusable component is just a function that returns a Block or an array of Blocks. Because page.content flattens arrays, a component that returns Block[] can be spread inline alongside other blocks.

A callout component

This component returns a single note block.

A section component

This component returns an array of blocks, a heading followed by a paragraph.

Using them in a page

Spread the array returning component, and pass the single block component directly.
Spreading works because content flattens arrays. A Block[] component composes the same as a single Block.
The repository includes a full reference at examples/simplified that puts these patterns together in one document.