Define a block
This is the blocknpm create reintersect scaffolds, shown with Zod:
src/taskBlock.tsx
.addBlock(TaskBlock). addBlock rejects a block without a view, so
call .render() first.
Every view follows the same anatomy: a Header, the body, one Actions row and an optional
Footer, in that order. The view says what each part is, and Reintersect decides the spacing, which
button is primary, the colours and how the block adapts to narrow widths. The task’s one button is
primary because it’s the first in Actions. See
What Reintersect decides.
Options
Schemas are any Standard Schema that also implements Standard JSON
Schema: Zod 4, ArkType and Valibot (through
toStandardJsonSchema). The Effect entry takes Effect
Schema. See Composing an app.
The render function
render receives the block’s props and a context object, and returns JSX. It can be async and
fetch live data:
src/deploymentCard.tsx
One render is shared by every viewer. The context has no viewer, so a render can’t show different
content to different people. To hide parts of a block from some viewers, use
audience; to collect a choice from each viewer, use
viewer inputs, whose counts Reintersect shows without a re-render.
When Reintersect renders
Reintersect calls your render function, validates and stores the resulting tree, and serves that stored tree to viewers. It renders again when:- The block is inserted, pasted or cloned.
- An action returns. The SDK renders with the new state and returns both in the same response.
- Your app pushes new state or asks for a revalidation through the API.
- Someone views the block after
staleAfterhas passed.
Where blocks come from
Blocks inserted through the API land only in circles your app can reach. See
Install and consent.
The summary
Block requires a summary of at most 280 characters of plain text. Reintersect uses it wherever the
full block can’t appear: notification text, Slack peers of a connected circle, search results and
the agent’s fallback text for the block. Write it as a sentence a teammate could read on its own:
Attribution
Every block shows a footer line with your app’s icon and “via <app name>”. Blocks from a development install also show a “Dev” label. You control the header, but you can’t remove or restyle the attribution line.Next steps
State and actions
Define actions, bind them to buttons and return the next state.
Viewer inputs
Votes and choices stored per member, with live tallies.