Primitives
Rendering a bound value, marking a unit, or reaching for the marker attribute a section's own browser code reads.
The primitives are the DOM the platform requires. A section's presentation — headings, links, layout, icons — is its own JSX; what is here is what the editor, the patcher and the capture break without, and nothing else.
Section is the root. The Slot namespace renders a bound value and owns its
marker, and its Slot.Object marks one object — a top-level object or one item
of a list of objects — as the editor's card. Image, Video and Tour are the rendering engines Slot.Image, Slot.Video
and Slot.Tour wrap, reached directly only for a value with no scalar slot
binding. FrameShell is the frame a host draws a rendered page inside. The ATTR_*
constants are those markers' attribute names, for a section's own browser code to
query by.
Which two short fields share a two-up row in the editor's sidebar is the
editor's rule, not the template's, and a section declares nothing about it. A
card's fields appear in the order its object declares them.
Section
Signature
import { Section } from "@homepages/concrete";
<Section as="header" className="bg-background">
{null}
</Section>;Parameters
as picks the element — section (the default), or <div>, <article>,
<header>, <footer> or <aside>. Every other prop is that element's own.
Constraints
Always exactly one Section at the root of a section's render. It is full-bleed
by contract: 100% width, zero margin, so consecutive sections butt edge to edge
and a page composes as a vertical stack with no framework whitespace. Never a
margin utility on it — that re-opens the gap, and concrete check reports it as
render/section-root-margin. Padding is yours, on this root or on a child; the
background still paints edge to edge beneath it. A centered, capped well is
ordinary JSX on a child.
Example
import { fact, fill, Section, Slot, section, text } from "@homepages/concrete";
export const Hero = section(
{
key: "hero",
label: "Hero",
slots: {
headline: text.medium({
label: "Headline",
cap: 80,
source: fill.write({ reads: [fact.property.description], brief: "What makes the property worth seeing. Write one sentence. Confident and specific." }),
}),
},
},
({ slot }) => (
<Section as="header" className="py-24">
<div className="mx-auto w-full max-w-5xl px-6">
<Slot.Text slot={slot.headline} as="h1" className="text-5xl" />
</div>
</Section>
),
);Rules that apply
render/section-root-margin,
pages/non-section-markup.
Slot
Signature
import { Slot } from "@homepages/concrete";
const kinds = [
Slot.Text,
Slot.Number,
Slot.Select,
Slot.Url,
Slot.Address,
Slot.Date,
Slot.Email,
Slot.Phone,
Slot.Image,
Slot.Video,
Slot.Tour,
Slot.Document,
Slot.Download,
Slot.List,
Slot.Object,
];Parameters
Every member takes slot — the binding, from the render's own slot map or from
bindItems. The four text-shaped kinds (Slot.Text, Slot.Number,
Slot.Select, Slot.Url), Slot.Date and Slot.List take a required as
naming the one element they render and mark; Slot.Email, Slot.Phone and
Slot.Download default as to <a>, Slot.Address to <div>, and Slot.Image, Slot.Video,
Slot.Tour and Slot.Document render their engine's own box. The rest props are that element's
props, so a wrong-element prop is a compile error.
Slot.Download links the original of an image, video or document slot's asset,
with your children inside the anchor, opening in a new tab unless you pass your own
target. An image links its whole picture whatever crop the slot shows, a hosted video
its file, a document the file itself; a video that is a provider link has no file and
renders with no link target. A tour slot is a compile error. Slot.Document embeds a PDF in
the browser's own viewer, inside the same frame Slot.Tour draws and your classes
size (frame={false} renders the bare <iframe>); a document that is not a PDF
renders the empty frame, so link it with Slot.Download instead.
Slot.Email and Slot.Phone write the link themselves: it is mailto: or
tel: on the stored value, whatever the display says. A phone prints a ten-digit
North American number as (512) 555-1234 by default; any other number prints as
stored. Slot.Date prints the stored YYYY-MM-DD day unless format says how it
reads.
Slot.Address takes children as a function rather than markup: it is handed the
address's parts and its derived display and street-without-type line, each null
when absent, or null itself when the slot holds no place, and whatever it returns
renders inside the marked element.
format supplies display text keyed off the value, children author markup
rendered in every branch, multiline splits the value on newlines into <br>,
and selectable={false} declines selection on one copy — identity stays, so the
copy is still patched live.
Slot.Object takes slot as an object's binding — a top-level object's
(slot.address), or one item of a list of objects from bindItems — and as,
default <div>. It takes no id and no label: a top-level object's identity is
its slot id and an item's is its index, and the card's title is the object's own
label. Its children are your markup, with each of the object's fields rendered
through its own binding, read straight off the object's (slot.address.street,
item.price). Over an item of an object's list of objects it marks the enclosing
field instead of an item: that item is part of one field's value, not a card of its
own.
Constraints
Always the primitive, never the raw value: concrete check reports a read off a raw
slots object as slots/no-raw-values, and a hand-written data-slot-*
attribute as slots/no-marker-literal. Always at least one selectable rendering
per editable slot, or render/missing-slot-marker fires — a slot marked only on
selectable={false} copies counts as none.
The marker survives the empty branch: a blank value still renders the marked
element, so an unfilled slot stays selectable instead of disappearing from the
editor. A date with no day — its "none" — renders the marked element empty, never
the word null; a blank email, phone or download renders it with no link target. format and
children withhold the text-leaf flag, because the element's text is then no
longer the value; multiline keeps it. Slot.Date, Slot.Email and
Slot.Phone never set it: the day is not what a reader types, and a link's
target would not follow a live text edit. Slot.Image
bound to a video, tour or document slot renders that asset's poster under that
slot's own identity — a document's is its first page, which the platform renders
only for a PDF. Slot.Address is never a text leaf: the parts are your
markup, and the element is marked in every branch, an address holding no place
included, so the empty branch is yours and the slot stays selectable.
Slot.Object accepts only an object's binding: a value slot, a list's own
binding, an item of a list of single values and a field's binding are each a
compile error, because none of them is a card. Every unlocked field of a
top-level object renders inside its Slot.Object, or render/missing-slot-marker
fires; a field marked outside its own object's container — top level or item — is
render/group-ancestry. Rendering the same object twice, a clone slide or a
second responsive branch, is another Slot.Object over the same binding, and
every copy is live.
Example
import { Section, Slot, bindItems, fact, fill, image, list, object, section, text } from "@homepages/concrete";
const photo = image({ label: "Photo", from: fact.property.property_media });
export const Gallery = section(
{
key: "gallery",
label: "Gallery",
slots: {
caption: text.short({
label: "Caption",
cap: 80,
source: fill.write({ reads: [fact.property.description], brief: "What the gallery shows. Write one sentence. Plain and factual." }),
}),
slides: list({
label: "Slides",
max: 12,
source: fill.pick({
brief: "A photograph of every room, front door first. Never anything that is not a photograph of the property.",
}),
item: object({
label: text.short({ cap: 60, source: fill.write({ reads: [fact.property.description, photo], brief: "Name the room the photo shows." }) }),
fields: { photo },
}),
}),
},
},
({ slot }) => (
<Section>
<Slot.Text slot={slot.caption} as="p" multiline />
<Slot.List slot={slot.slides} as="ul" className="grid grid-cols-3 gap-4">
{bindItems(slot.slides).map((item) => (
<Slot.Object key={item.index} slot={item} as="li">
<Slot.Image slot={item.photo} className="aspect-[4/3] w-full" />
<Slot.Text slot={item.label} as="figcaption" />
</Slot.Object>
))}
</Slot.List>
</Section>
),
);A top-level object is the same primitive over the object's own binding:
import { Section, Slot, compute, fact, number, object, row, section, text } from "@homepages/concrete";
const unit = row({ label: "Unit", from: fact.property.units, locked: true });
export const Sheet = section(
{
key: "sheet",
label: "Fact sheet",
slots: {
address: object({
label: compute(() => "Property address"),
fields: {
street: text.short({ label: "Street", source: fact.property.address.street }),
city: text.short({ label: "City", source: fact.property.address.city }),
},
}),
stats: object({
label: compute(() => "Key stats"),
fields: {
unit,
beds: number({ label: "Beds", source: unit.beds }),
baths: number({ label: "Baths", source: unit.baths }),
},
}),
},
},
({ slot }) => (
<Section>
<Slot.Object slot={slot.address} as="address" className="not-italic">
<Slot.Text slot={slot.address.street} as="span" />
<Slot.Text slot={slot.address.city} as="span" />
</Slot.Object>
<Slot.Object slot={slot.stats} as="dl">
<Slot.Number slot={slot.stats.beds} as="dd" />
<Slot.Number slot={slot.stats.baths} as="dd" />
</Slot.Object>
</Section>
),
);An address renders through your own function of its parts:
import { Slot, type AddressSlot, type SlotBinding } from "@homepages/concrete";
export function PostalLines({ slot }: { slot: SlotBinding<AddressSlot> }) {
return (
<Slot.Address slot={slot} as="address" className="not-italic">
{(address) =>
address === null ? (
"Address to come"
) : (
<>
{address.street}
<br />
{address.city}, {address.state} {address.postal}
</>
)
}
</Slot.Address>
);
}Rules that apply
slots/no-raw-values,
slots/no-marker-literal,
render/missing-slot-marker,
render/group-ancestry.
bindItems
Signature
import { fact, fill, Image, Slot, bindItems, image, list, section } from "@homepages/concrete";
const shots = list({
label: "Photos",
max: 6,
source: fill.pick({ brief: "The six photos that best show the home." }),
item: image({ from: fact.property.property_media }),
});
export const Strip = section({ key: "strip", label: "Strip", slots: { shots } }, ({ slot }) => {
const items = bindItems(slot.shots);
return (
<Slot.List slot={slot.shots} as="ul">
{items.map((item) => (
<li key={item.index} data-first={item.index === 0}>
<Image value={item.value} />
</li>
))}
</Slot.List>
);
});Parameters
One list binding — a top-level slot binding, or an object's field that is itself
a list, of values or of objects. It returns one binding per item, each carrying slot (the list's
own identity), index, value and present; an item of a list of objects also
carries its object() as def, and one binding per field it declares, read
straight off the item (item.price) — the object's locked label among them, as
label, when that label is a source. A label naming one of the
object's own fields adds no binding: the title is that field's.
Constraints
Always this, never an index into the raw value: the returned binding is what
carries an item's marker, and a Slot.* handed a bare value has no identity to
emit. Iteration itself is plain React — .map, a filter, a slice, two layout
branches — because an item binding is an ordinary value.
Never a fifth dimension: an object never holds another object, so identity stops at
slot, item, field. An object's field that is a list of objects is one field, one
level deep: bindItems over it returns items that each carry the field's own
address as their enclosing field, and every field binding of such an item carries it
in place of its own — so whatever the item renders marks, and selects, the
enclosing field.
Example
import { Section, Slot, bindItems, fact, list, number, object, row, section, text } from "@homepages/concrete";
export const Comps = section(
{
key: "comps",
label: "Comparables",
slots: {
rows: list({
label: "Comparables",
source: fact.property.comparables,
max: 6,
item: (el) => {
const comp = row({ label: "Comparable", from: fact.property.comparables, source: el });
return object({
label: comp.address.street,
fields: { comp, price: number({ label: "Price", source: comp.price }) },
});
},
}),
},
},
({ slot }) => (
<Section>
<Slot.List slot={slot.rows} as="table">
<tbody>
{bindItems(slot.rows).map((item) => (
<Slot.Object key={item.index} slot={item} as="tr">
<Slot.Text slot={item.label} as="td" />
<Slot.Number slot={item.price} as="td" format={(value) => `$${value.toLocaleString()}`} />
</Slot.Object>
))}
</tbody>
</Slot.List>
</Section>
),
);Rules that apply
Image
Signature
import { Image } from "@homepages/concrete";
import type { ImageValue } from "@homepages/concrete";
declare const value: ImageValue | null;
<Image value={value} frame fit="cover" sizes="(min-width:1024px) 1200px, 100vw" className="aspect-video" />;Parameters
value is the whole resolved value — the url, the alt, the mobile crop and the
responsive ladder are read off it, so a call site cannot unpack four fields and
forget the fifth. alt overrides the value's own and is required when the
value is a template-shipped asset, which carries none. frame (default true)
wraps the image in the framework's clipped, tinted box; fit is the object-fit;
sizes and maxRungWidth shape the candidate set; mobileBreakpoint gates the
mobile crop as a <picture> source; rendition commits this element to one
rendition instead. Every remaining <img> attribute passes through.
sizes is optional. A lazy image — the default — emits sizes="auto, …", so the
browser picks the rung from the box the image occupies; your sizes is the
fallback for a browser without sizes="auto", and 100vw when you give none. An
eager image is fetched before layout, where sizes="auto" does not apply: give one that is not
full-width a sizes, or it fetches a rung for the whole viewport.
Constraints
The frame has no geometry of its own — your className lands on it and your
classes are its whole box. frame={false} renders the bare <img>, and the
parent owns the box. An absent value renders a marked placeholder either way, so
the slot never vanishes; an <img> that renders with no source at all is
render/broken-image.
Never reach for this to render a bound scalar slot — that is Slot.Image, which
also reads the slot's declared mobile breakpoint so the cut the cropper made is
the cut the page serves. Reach for Image for a value with no scalar binding: a
item of a list you are laying out yourself, an asset the template ships.
Example
import { fact, fill, Image, Section, Slot, bindItems, image, list, section } from "@homepages/concrete";
export const Strip = section(
{
key: "strip",
label: "Strip",
slots: {
shots: list({
label: "Photos",
max: 8,
source: fill.pick({ brief: "A spread across the whole home." }),
item: image({ from: fact.property.property_media }),
}),
},
},
({ slot }) => (
<Section>
<Slot.List slot={slot.shots} as="ul" className="flex gap-2">
{bindItems(slot.shots).map((item) => (
<li key={item.index}>
<Image value={item.value} className="aspect-square w-40" />
</li>
))}
</Slot.List>
</Section>
),
);Rules that apply
render/broken-image,
render/unresolved-media.
Video
Signature
import { Video } from "@homepages/concrete";
import type { VideoValue } from "@homepages/concrete";
declare const value: VideoValue | null;
<Video value={value} frame fit="cover" preview className="aspect-video" />;Parameters
value is the whole resolved value; alt overrides its own. frame (default
true) and fit behave as on Image. playback is the slot's declared
playback config — absent means a plain controls player. preview renders a
muted, looping, controls-free teaser and overrides playback.
Constraints
Two branches, chosen by the value and not by you: an upload renders a <video>
over its transcoded rendition, a pasted provider link renders a lazy <iframe>
over an embed source the resolver already finished. There is no responsive ladder
— one progressive file per hosted video, poster baked upstream.
A preview is decorative by definition: muted, no control bar, metadata-only
preload. To preview and then play, render a second Video on the same slot.
Example
import { fact, fill, Section, Slot, Video, bindItems, list, section, video } from "@homepages/concrete";
export const Reel = section(
{
key: "reel",
label: "Reel",
slots: {
clips: list({
label: "Clips",
max: 4,
source: fill.pick({ brief: "The walkthrough clips, longest first." }),
item: video({ from: fact.property.property_media }),
}),
},
},
({ slot }) => (
<Section>
<Slot.List slot={slot.clips} as="div" className="grid gap-4">
{bindItems(slot.clips).map((item) => (
<Video key={item.index} value={item.value} preview className="aspect-video w-full" />
))}
</Slot.List>
</Section>
),
);Rules that apply
render/unresolved-media,
render/missing-slot-marker.
Tour
Signature
import { Tour } from "@homepages/concrete";
import type { TourValue } from "@homepages/concrete";
declare const value: TourValue | null;
<Tour value={value} frame className="aspect-video" />;Parameters
value is the whole resolved value — the embed url and the alt that titles the
<iframe> are read off it. alt overrides. frame (default true) is the same
clipped, tinted box as on Image and Video.
Constraints
One branch, not two: a tour is always a provider embed, so there is no <video>
half and no playback or fit. The url is the finished embed source,
rewritten once at resolve, so this component is a pure read.
Empty is a neutral rectangle, never a poster facade. The tour's thumbnail is
a separate rendering: bind the same slot to Slot.Image, which renders the
poster under the tour slot's own identity. fit is not offered — it does nothing
to a replaced-element iframe.
Example
import { fact, fill, Section, section, Slot, Tour, tour } from "@homepages/concrete";
export const Walkthrough = section(
{
key: "walk",
label: "Walkthrough",
slots: {
tour: tour({
label: "3D tour",
from: fact.property.property_media,
source: fill.pick({ brief: "The whole-home walkthrough, not a single-room scan." }),
}),
},
},
({ slot }) => (
<Section>
<Slot.Image slot={slot.tour} className="aspect-video w-full" />
<Tour value={slot.tour.value} className="aspect-video w-full" />
</Section>
),
);Rules that apply
FrameShell
Signature
import { FrameShell, deck16x9 } from "@homepages/concrete";
<FrameShell format={deck16x9}>{null}</FrameShell>;Parameters
format is an image or document format value — never the website format, which
has no geometry. children are the page's sections, direct.
Constraints
The rendered class's page root, and the host renders it — the playground, the
capture, the publisher — around the sections a page places. A template never
writes it: a page that contains anything but sections is
pages/non-section-markup, and a frame root is
exactly that. It is exported because every host owes byte-identical frame markup,
and this is the one definition of it.
The shell is the viewport — it fills the window its host owes it, clips at its own edge and lays the sections out as a rigid column, so an overflowing stack overflows measurably instead of being silently squeezed. Never a wrapper element between the shell and a section: the wrapper becomes the flex child and the section stops being one.
The shell draws nothing — trim and bleed guides are host chrome, so the rendered bytes are identical in every host. It sets the three geometry custom properties and stamps the format's id for the per-format variants to select on.
Example
import { FrameShell, instagramPortrait } from "@homepages/concrete";
import type { ReactNode } from "react";
declare const pageMarkup: ReactNode;
// A host framing one rendered page — not something a template writes.
export function frame(): ReactNode {
return <FrameShell format={instagramPortrait}>{pageMarkup}</FrameShell>;
}ATTR_SLOT_ID
Signature
import { ATTR_SLOT_ID } from "@homepages/concrete";
const attribute: string = ATTR_SLOT_ID; // "data-slot-id"Constraints
The element an editable slot's value was rendered on. Emitted by every Slot.*
primitive from the binding's own identity, in every branch including the empty
one — a slot may carry it on several elements, and each is a live editing target.
Always the constant, never the string: concrete check bans a data-slot-* literal
anywhere in a workspace (slots/no-marker-literal), written or read, because
code that spells the marker itself drifts from the primitives that emit it.
Import one only to query the DOM from a section's own browser-side code.
Example
import { ATTR_SLOT_ID } from "@homepages/concrete";
export function slotIdOf(el: Element): string | null {
return el.closest(`[${ATTR_SLOT_ID}]`)?.getAttribute(ATTR_SLOT_ID) ?? null;
}Rules that apply
slots/no-marker-literal,
render/missing-slot-marker.
ATTR_SLOT_TEXT_LEAF
Signature
import { ATTR_SLOT_TEXT_LEAF } from "@homepages/concrete";
const attribute: string = ATTR_SLOT_TEXT_LEAF; // "data-slot-text-leaf"Constraints
Present, value-less, when the raw value is the marked element's entire text —
the mechanical form of the leaf rule, which is what lets the editor type into the
page. A format or children render withholds it, because the element then says
something the value is not; multiline keeps it, and the editor learns the
<br>.
Never authored: it is derived per render by the primitive.
Example
import { ATTR_SLOT_TEXT_LEAF } from "@homepages/concrete";
export function typesLive(el: Element): boolean {
return el.hasAttribute(ATTR_SLOT_TEXT_LEAF);
}ATTR_SLOT_GROUP
Signature
import { ATTR_SLOT_GROUP } from "@homepages/concrete";
const attribute: string = ATTR_SLOT_GROUP; // "data-slot-group"Constraints
The container of a sidebar card in a section built by a Concrete older than 9.0,
carrying that card's id. No primitive emits it: a card is an object, and its
Slot.Object carries ATTR_SLOT_ID like any other slot. Read it only to query a
page whose markup predates that.
Example
import { ATTR_SLOT_GROUP } from "@homepages/concrete";
export function cardOf(el: Element): string | null {
return el.closest(`[${ATTR_SLOT_GROUP}]`)?.getAttribute(ATTR_SLOT_GROUP) ?? null;
}ATTR_SLOT_ITEM
Signature
import { ATTR_SLOT_ITEM } from "@homepages/concrete";
const attribute: string = ATTR_SLOT_ITEM; // "data-slot-item"Constraints
The zero-based index of one item inside a list — the per-item handle the editor
resolves selection, live surfaces and per-item crops against. Emitted by
Slot.Object over one ItemBinding of a top-level list of objects, and by nothing
else — an item of an object's list of objects marks its enclosing field instead.
It resolves scoped to the enclosing slot marker, so an outer list's lookup can
never reach into a list rendered inside one of its own items. A list of single
values, which the editor edits as one card, carries none: its items are not
objects, so no Slot.Object accepts them.
Example
import { ATTR_SLOT_ITEM } from "@homepages/concrete";
export function rowIndexOf(el: Element): number | null {
const raw = el.closest(`[${ATTR_SLOT_ITEM}]`)?.getAttribute(ATTR_SLOT_ITEM);
return raw == null ? null : Number(raw);
}ATTR_SLOT_FIELD
Signature
import { ATTR_SLOT_FIELD } from "@homepages/concrete";
const attribute: string = ATTR_SLOT_FIELD; // "data-slot-field"Constraints
The field name of one field of one object — a top-level object's or one item's —
the last dimension of slot identity, (instance, slot, item, field). A Slot.*
handed a field binding emits this in place of ATTR_SLOT_ID, structurally: only a
slot binding carries an id. The object it belongs to is the nearest Slot.Object
marker around it.
It is a scope boundary exactly as ATTR_SLOT_ID is. There is no fifth dimension,
because an object never holds another object.
Example
import { ATTR_SLOT_FIELD } from "@homepages/concrete";
export function fieldNameOf(el: Element): string | null {
return el.closest(`[${ATTR_SLOT_FIELD}]`)?.getAttribute(ATTR_SLOT_FIELD) ?? null;
}ATTR_SLOT_UNSELECTABLE
Signature
import { ATTR_SLOT_UNSELECTABLE } from "@homepages/concrete";
const attribute: string = ATTR_SLOT_UNSELECTABLE; // "data-slot-unselectable"Constraints
A presence flag declaring one rendering non-selectable — a carousel clone, a
responsive mirror. Emitted by selectable={false} on any marked primitive.
The copy keeps full identity, so patches still reach it, but the canvas never
selects, outlines or scrolls to it and a click falls through. Coverage counts no
flagged copy: a slot whose every rendering carries this is a slot with no
rendering at all, and render/missing-slot-marker fires.
Example
import { ATTR_SLOT_UNSELECTABLE } from "@homepages/concrete";
export function selectable(el: Element): boolean {
return !el.hasAttribute(ATTR_SLOT_UNSELECTABLE);
}ATTR_SECTION_INSTANCE_ID
Signature
import { ATTR_SECTION_INSTANCE_ID } from "@homepages/concrete";
const attribute: string = ATTR_SECTION_INSTANCE_ID; // "data-section-instance-id"Constraints
Per-instance identity on a section root, so two placements of one section on a
page are two editable things. It is host-injected, not emitted by Section:
the editor canvas stamps it around what a section rendered.
Never authored, and never needed to scope an island — useEditor resolves the
island's own instance for you and hands back a selection already scoped to it.
Example
import { ATTR_SECTION_INSTANCE_ID } from "@homepages/concrete";
export function instanceOf(el: Element): string | null {
return el.closest(`[${ATTR_SECTION_INSTANCE_ID}]`)?.getAttribute(ATTR_SECTION_INSTANCE_ID) ?? null;
}ATTR_TR_ENHANCE
Signature
import { ATTR_TR_ENHANCE } from "@homepages/concrete";
const attribute: string = ATTR_TR_ENHANCE; // "data-tr-enhance"Constraints
An opt-in hook: a section writes it on one of its own elements and its own browser code finds that element by it. It is wired between a section's markup and that section's script, and the editor's slot resolver never observes it.
Never a substitute for a slot marker — it carries no identity, so nothing patches or selects through it. Prefer an island, which has a component, props and a declared editor behaviour; reach for this only where the enhancement is markup a section already rendered.
Example
import { ATTR_TR_ENHANCE } from "@homepages/concrete";
export function enhanceTargets(root: ParentNode): Element[] {
return Array.from(root.querySelectorAll(`[${ATTR_TR_ENHANCE}]`));
}See also
Islands for the client half of a section's markup,
fixtures for the values these render in concrete dev and
concrete check,
the rest of the reference, and every rule.
