@reintersect/sdk/recipes that returns a
complete block type, with its props, state, actions and view, built only from the
component catalog. Call the factory with a block type, add the result to
your app, and insert it like any block you wrote yourself:
src/app.ts
The result is an ordinary block definition, so
.insert(props, { state }),
reintersect.blocks.update(LunchPoll, …) and the testing kit work with it. Each recipe
also exports its props and state schemas (for example PollPropsSchema and PollStateSchema), so
your own code can build valid values.
On the Effect entry, import the same factory names from @reintersect/sdk/effect/recipes. Recipe
schemas are Effect Schemas in both entries, even when the rest of your app describes its blocks with
Zod.
Recipes follow the same rules as your own blocks: they choose structure, numbers and states, and
Reintersect decides spacing, emphasis, size and colour. The first button in a recipe’s Actions that
isn’t destructive is its primary button, so each recipe orders its buttons with that in mind.
Available recipes
Approval
Named approvers approve or reject; either decision locks the block.
Poll
Single or multiple choice with live counts and a close button.
RSVP
Going, maybe or can’t go, with a headcount and optional capacity.
Checklist
A shared list anyone can tick off, with progress.
Deployment
Steps and status your pipeline pushes, with cancel and retry.
Incident
From investigating to resolved, with an update form.
Ticket
Status, priority, tags and assignee; works as a reference block.
Metrics panel
Headline metrics and a chart per time range.
Reading the source
Each recipe is about 200 lines of plain components inpackages/sdk/src/recipes.
When a recipe is close to what you need, copy its view into your own defineBlock and change it. The
exported view components, such as PollView, take the same props and handles the recipe passes.