A complete template
email-digest is a whole template: an envelope, one layout, and the parts it places. It
composes one letter for one reader.
components/ folder as flat files with no manifest,
because a manifest is for being discovered and a template’s parts never are. Each is a
normal component with its own props and its own drawing.
Placing a part
A layout places one of its template’s parts with the same element that places anything else, aRef whose ref is the part’s path:
Ref into the template’s own components/ folder is a part. It is drawn where you put
it, and the part’s file name is its name on the page: components/subject is the part
subject. Everything else on the line, such as a style, rides through to the place it
is drawn.
What an Agent writes is decided by the part’s props, and by nothing else. Each prop
marked input: true is filled by an Agent or a workflow, and each prop marked
input: false is drawn from its default, as designed. A masthead whose props are all
input: false never changes; a body whose props are input: true is written for every
reader. The layout only arranges.
You never author ComponentSlot, select or where in a template. A placed part
compiles to those primitives when the template is served, so the renderer stays dumb.
Holding a component
A template holds one of the project’s own components with the sameRef, inside an Each
over the things it shows. Each item becomes its own instance of that component:
Ref to a component whose states name places, inside an Each, is held rather than
drawn flat. Each item’s fields fill the component’s props by name, so the item carries the
component’s own prop names. Each held instance is keyed by its item’s id.
The held component keeps its own state (State: inside a template). It
arrives in its first state, in its spot in the template. Tapped, it writes its own page and
opens in the place that state names, laid over the template. Its ✕ writes grid and it is
back in its spot. The template never holds the component’s fields in its values:, and
never gives it a step of its own to open into.
Where the opened one goes. In an app, a held component opens in the place its state names,
laid over the template. Where there is no such place, as in studio or on a web page, it
opens in its own spot inside the template.
Writing into a part
A part’s written fields are itsinput: true props, each with a description written as
direction to a writer, including what not to do
(Components covers props):
input: true props, gathered under each
part’s name in the order the page reads. An Agent fills the whole page in one call.
A list of found things
A part can hold things the Agent found rather than wrote: products, places, articles. Give it an array prop whose item fields are all hydrated, and each item collapses to one requiredref, the result the Agent picked. Its name, words, picture and link arrive with
the result, so nothing about the thing itself is ever invented:
maxItems is how many the part holds, and the referee enforces it.
Pictures
You never author or search for a part’s picture. A found item always shows its own image: it arrived with the content, and it is data. Every other image slot (a written part’s banner, a section’s mood image) is assigned by the platform from the page’s own pool: the pictures carried by all the content the page holds, best first. The same photograph appearing on an item and as the banner is normal design, and a slot is only ever empty when the page holds no pictures at all. So a component that wants a picture declares an image prop (writer vocabulary:primaryImage) and stops there. No search for it, nothing to wire.
A template that asks
A template hands answers back exactly as a component does (Components: a component that asks): anoutputs: block on the
envelope names the answers, and the button that finishes it ends in type: submit. The
fields it asks for are its parts’ input: true props, so an Agent working it asks for each
one still empty, and the person’s answer fills it.
Slides
A template whose steps are slides says so witharrows: true on the state that holds them,
and the arrow keys step it. Only a state marked so answers the keys: a form whose last step
is its thanks leaves it out, so the keys never skip the form.
Preview
studio seeds every part from each prop’spreview: (falling back to default:), so
the arrangement reads as finished while you design, before any Agent has written a word.
Give an array prop a preview: list of realistic items, mock content included. Without
one the array seeds empty, a visibleWhen on it hides the whole part, and the template
previews with the part simply missing, which reads as a bug rather than as an empty mock.
Every preview is ignored at runtime. A real fill replaces all of it.
Blocks
A block is a small reusable template: a band that holds the reading measure, a two-column pair, a card frame. It exists so a page’s column arithmetic is written once instead of repeated on every band. A block is not a new kind. It is a flat template file in the templates home withcategory: Block and no manifest, and its whole body is a root: drawing:
Ref, exactly like an atom. A Ref carrying children: fills the
block’s opening with your own content, and a Ref without children keeps the block’s:
background: surface.base with border: subtle so
they read against the canvas.
The sorting test against an atom: an atom is leaf vocabulary a component composes, while a
block is page arrangement a template composes. If it holds parts, it is a block.
Arriving in an app
A template is streamed into an app exactly as a component is. Its external state names the place it shows in, and the app opens that place. The app never names a template:How an Agent finds it
Yourmanifest.yaml carries the four fields that decide whether this is ever chosen:
title, description, whenToUse and category. The rules are identical for every kind,
they are enforced by the deploy lint, and
Node discoverability is the contract.
A template that a workflow works names it in the same manifest, the field an app carries:
autoTrigger: true to the binding and the workflow runs once, on load, with nothing to press:
the right shape for a template that only shows what a workflow reads, such as a list filled
from a store. Without it, the task waits for the visitor.
Next steps
Apps
Arrange templates into the whole experience.
State
The reaction contract templates and interfaces share.

