Concrete
Reference

Slot builders

Looking up a slot's kind, its options, and what the editor and the fill do with each — and the list, object and row that shape them.

Every builder takes the same four head options. label is required on every top-level slot and on every field of an object, and is never derived from the slot key — the key is the identifier, the label the human name, two independent facts. A list's item may omit it. locked opts the slot out of editing; absent means editable. placeholder is the editor's empty-state hint. when gates the slot on a declared variant case, as a bare case string or a list of them.

source is the one origin, and a slot declares it once: a fact ref binds the slot, a row's member (agent.phone) binds it to one element of a table, a slot ref — off another section, or a sibling slot's own const — makes it a MIRROR, compute() derives it, and a fill — fill.write, fill.pick or fill.find — has the model produce it (sources). The first four are live; a filled slot is produced once and is the user's after. Where an edit to the slot goes follows from its source, never from an option (Facts and provenance).

Which origins a kind takes is the kind's own business, and the type of its source: is what says so — down to which fill verb and options it admits. url, date, email and phone take fill.write, held to their form; number takes fill.write only for an estimate, never a fact; document binds no fact field, because none holds one; address is bound — the property's address, a row's address member, a compute() or another address — or found, never written; and poi takes no source at all. Each member below states what its own kind admits.

A media slot — image, video, tour or document — also says what the user picks its value from. from names the property's media list it picks out of — fact.property.property_media for what shows the property (its photos, videos and tours), fact.property.floor_plans for its plans, fact.property.uploads for everything it holds — and its candidates are that list's assets of the slot's kind, exactly what the editor's picker offers. from may name several lists in order (from: [fact.property.floor_plans, fact.property.uploads]): the candidates are their union, list by list, an asset two lists hold offered once. Each list is named once and holds items that can be of the slot's kind, and from: a and from: [a] are one declaration. Without from the slot owns its asset: the user uploads or pastes one into it, and nothing picks it. A slot bound to a fact — a row's member, an element, or the item of a list so bound (a list over unit.floor_plans among them) — holds what that fact holds and states no from, and neither does a mirrored one. The candidates are what the user is offered and what a pick chooses from, so a filled media slot states them once, and a fill.pick on a media slot always names its from. The three lists bind no media slot: a compute() or a fill reads them, and a slot picks out of one by naming it.

Three builders shape the others rather than holding a value of their own. list holds items, object groups fields into one card, and row holds one row of the table its from names and is the only way to read its members. An address reads its own parts the same way a row reads its members.

text

Signature

import { text } from "@homepages/concrete";

const headline = text.medium({ label: "Headline", cap: 60 });
const body = text.long({ label: "Body copy", cap: 600 });
const badge = text.short({ label: "Badge", cap: 24 });

Parameters

cap is the slot's character budget: it bounds what a user may type, and a fill.write producing the slot writes to it. As a written list's item, text.short({ cap: 40 }) is the kind and the budget of every item.

The size is the member, not an option — text.short, text.medium or text.long picks the editor's input and the prose length the slot is for.

Constraints

Always one of the three sizes. There is no bare text builder to call.

Always a cap on a filled slot: the budget is declared once, on the slot, and a fill takes none.

Never a cap on a slot whose value the platform owns.

A fill here is fill.write, and takes brief, reads and none. A contact's scalar fields are bound, not filled: source: contact.name, a member of a row of the contacts table.

Example

import { fact, fill, text } from "@homepages/concrete";

const street = text.short({
  source: fact.property.address.street,
  label: "Street",
});

const headline = text.medium({
  cap: 60,
  label: "Headline",
  source: fill.write({
    reads: [fact.property.address, fact.property.description],
    brief: "A marketing headline for the property. Write one sentence. Confident, no exclamation marks.",
  }),
});

Rules that apply

contract/cap, contract/source.

number

Signature

import { fact, number, row } from "@homepages/concrete";

const unit = row({ label: "Unit", from: fact.property.units, locked: true });

const sqft = number({
  source: unit.sqft,
  label: "Square feet",
  thousandsSep: true,
});

Parameters

thousandsSep groups the figure with , (1,630). decimals admits a fraction (2.5); without it the figure is a whole number. maxDigits caps the digit count the editor accepts.

Constraints

Slot.Number renders the value as thousandsSep and decimals declare, and the editor's live preview shows the same text; an author format replaces that display. A unit such as a dollar sign or square feet is the section's own markup around the value, never a declaration.

A figure the platform holds is a fact, and is always bound: a fact, a slot or a compute() or a row's member. A fill.write is for a figure that is a judgement rather than a fact — an estimate the model proposes and the user confirms, such as a suggested price. The model answers a plain number, rounded to a whole one unless the slot declares decimals, and never negative or longer than maxDigits; a figure it cannot give is retried once, then left empty. It takes brief, reads and none. A number field of a list's object item takes no fill at all.

Example

import { compute, fact, fill, number, row } from "@homepages/concrete";

const unit = row({ label: "Unit", from: fact.property.units, locked: true });

const beds = number({
  label: "Bedrooms",
  source: compute({ reads: [unit.beds] }, (beds) => beds ?? 0),
});

const suggested = number({
  label: "Suggested list price",
  thousandsSep: true,
  source: fill.write({
    reads: [fact.property.units, fact.property.comparables],
    brief:
      "The price this home most likely sells at, as a proposal the listing agent confirms. " +
      "Weigh the nearest, most recent, most similar sold comparables most. Whole dollars, rounded to $5,000.",
  }),
});

Rules that apply

contract/source.

select

Signature

import { fact, select } from "@homepages/concrete";

const status = select({ label: "Status", from: ["for_sale", "sold"] });

const intent = select({
  label: "Listing intent",
  source: fact.property.listing_intent,
});

Parameters

select({ label, from, source?, creatable? }) declares a hand-authored vocabulary: from is the set the value is chosen from — a bare string in it is its own label, and { value, label } separates the stored key from the display text. The object form may also carry an icon, one of the editor's icons (IconName), and a one-line description; the editor's dropdown draws the icon before the label and the description beneath it. Neither is stored or reaches your render. select({ label, source: fact.… }) derives the vocabulary from the bound fact instead — the field's domain is the set, so one binding emits both the value's provenance and its choices.

creatable lets the editor add a key the vocabulary does not carry.

The same export is also the display entry builder, told apart by its missing label: under display:, select({ from, source, locked? }) declares a section's visibility or variant axis, its source a compute() or a fill.pick that picks one case of its from. The first case is the default and the failure posture, and locked opts a variant out of user switching. A labeled select is a slot, which display: refuses; an unlabeled one is an entry, which slots: refuses.

Constraints

Always exactly one vocabulary: from or a fact source, never both.

Always exactly one origin on a display entry — a compute() or a fill.pick. A display pick chooses from the entry's from, exactly, and takes brief and reads; it takes no none and no unique, because an entry always resolves one case.

Never a fill on a top-level select: it is bound, never filled. A field of a list's object item does take one — source: fill.pick({ brief }), which picks one key per item out of the keys the field's own from names — or binds the element when the list's elements are its keys (source: key).

Example

import {
  bindItems,
  compute,
  fact,
  fill,
  list,
  object,
  row,
  Section,
  section,
  select,
  Slot,
} from "@homepages/concrete";

const LAYOUTS = ["classic", "editorial"] as const;

const EMPHASIS = [{ value: "regular", label: "Regular" }, { value: "highlight", label: "Highlight" }] as const;

export const Overview = section(
  {
    key: "overview",
    label: "Overview",
    display: {
      visibility: select({
        from: ["visible", "hidden"],
        source: compute({ reads: [fact.property.property_media] }, (media) =>
          media.some((asset) => asset.kind === "image") ? "visible" : "hidden",
        ),
      }),
      variant: select({
        from: LAYOUTS,
        // Unlocked: every property starts on the first case, and the user switches in the section's settings.
        source: compute(() => "classic" as const),
      }),
    },
    slots: {
      // Top level: bound, and the binding supplies the vocabulary as well as the value.
      intent: select({ label: "Listing intent", source: fact.property.listing_intent }),
      comps: list({
        label: "Comparable sales",
        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,
              // In an item: hand-authored keys, and the one fill a select takes.
              emphasis: select({
                label: "Emphasis",
                from: EMPHASIS,
                source: fill.pick({ reads: [comp.distance_m, comp.sale_date], unique: false, brief: "Highlight the closest, most recent sales." }),
              }),
            },
          });
        },
      }),
    },
  },
  ({ slot }) => (
    <Section>
      <Slot.Select slot={slot.intent} as="span" />
      <Slot.List slot={slot.comps} as="ul">
        {bindItems(slot.comps).map((item) => (
          <Slot.Object key={item.index} slot={item} as="li">
            <Slot.Text slot={item.label} as="span" />
            <Slot.Select slot={item.emphasis} as="span" />
          </Slot.Object>
        ))}
      </Slot.List>
    </Section>
  ),
);

Rules that apply

contract/select, contract/display.

url

Signature

import { url } from "@homepages/concrete";

const tourLink = url({ label: "Tour URL", accepts: "tour" });

Parameters

accepts names a single link kind ("tour") or link-provider id ("matterport") the value must match.

Constraints

Always a link kind or provider a registered provider implements. A link kind with no provider behind it admits no url at all, which the type cannot say — check time rejects it.

A fact, a row's member, a slot, a compute() or fill.write sources it. A write is a full web address — a missing https:// is added, a value with a user part (agent@example.com) is an email, not a url — that the slot's accepts admits; one still not a link after one retry is reported as a failed fill and never stored. Never a cap: the form bounds its length.

Reach for url({ accepts: "file" }) rather than document when the file lives somewhere the platform neither stores nor serves.

Example

import { url } from "@homepages/concrete";

const floorPlanPdf = url({ label: "Floor plan PDF", accepts: "file" });

Rules that apply

contract/url.

date

Signature

import { date } from "@homepages/concrete";

const saleDate = date({ label: "Sale date" });

Constraints

Always a calendar day stored as YYYY-MM-DD, or null — the explicit "none", as for a comparable that has not sold. Render it with Slot.Date, whose format decides how the day reads; the stored value never carries a time or a zone.

Never a per-kind option, and never a cap. Like url, a slot, a list's item or an object's field binds a fact, a row's member (comp.sale_date), a slot or a compute(), or takes fill.write; a day the user types is an item of a list they build, or a field of its objects. A write is a YYYY-MM-DD day: a date-time is cut to its day and 2026-6-3 padded, but "June 3rd" or a range is never guessed at — a value still not a day after one retry is reported as a failed fill and never stored. A fixture stating a day that does not exist fails concrete check.

Example

import { date, fact, list, object, row } from "@homepages/concrete";

const openHouses = list({ label: "Open house days", max: 4, item: date({}) });

const comparables = list({
  label: "Recent sales",
  source: fact.property.comparables,
  item: (el) => {
    const comp = row({ label: "Comparable", from: fact.property.comparables, source: el });
    const sold = date({ label: "Sale date", source: comp.sale_date });
    return object({ label: comp.address.street, fields: { comp, sold } });
  },
});

Rules that apply

fixtures/value-invalid.

email

Signature

import { email } from "@homepages/concrete";

const inbox = email({ label: "Email" });

Constraints

Always an email address, or blank. Render it with Slot.Email, which links the stored address with mailto: — no section builds that link by hand.

Never a per-kind option, and never a cap. Like url, a slot, a list's item or an object's field binds a fact, a row's member (agent.email), a slot or a compute(), or takes fill.write; an address the user types is an item of a list they build, or a field of its objects. A write drops a leading mailto:, and a value still not an address after one retry is reported as a failed fill and never stored. A fixture stating something that is not an address fails concrete check.

Example

import { email, fact, list, object, row, text } from "@homepages/concrete";

const team = list({
  label: "Team",
  source: fact.property.contacts,
  item: (el) => {
    const agent = row({ label: "Agent", from: fact.property.contacts, source: el });
    const name = text.short({ label: "Name", source: agent.name });
    return object({
      label: name,
      fields: { agent, name, email: email({ label: "Email", source: agent.email }) },
    });
  },
});

Rules that apply

fixtures/value-invalid.

phone

Signature

import { phone } from "@homepages/concrete";

const office = phone({ label: "Office phone" });

Constraints

Always a number a dialer can call — digits with the usual separators and an optional leading +, seven to fifteen digits — or blank. Render it with Slot.Phone: its link dials the stored value with tel:, and it prints a ten-digit North American number as (512) 555-1234 unless you pass a format.

Never a per-kind option, and never a cap. Like url, a slot, a list's item or an object's field binds a fact, a row's member (agent.phone), a slot or a compute(), or takes fill.write; a number the user types is an item of a list they build, or a field of its objects. A write drops a leading tel: and keeps the model's formatting, and a value still not dialable after one retry is reported as a failed fill and never stored. A fixture stating letters or an extension fails concrete check.

Example

import { list, object, phone, text } from "@homepages/concrete";

const name = text.short({ label: "Name" });
const hosts = list({
  label: "Open house hosts",
  item: object({ label: name, fields: { name, mobile: phone({ label: "Mobile" }) } }),
});

Rules that apply

fixtures/value-invalid.

address

Signature

import { address } from "@homepages/concrete";

const place = address({ label: "Address" });
const parts = [place.street, place.unit, place.city, place.state, place.postal, place.latitude, place.longitude];

Constraints

Always one place: its street, unit, city, state and postal code, and its coordinates, held as one value because the parts and the pin must agree. The value resolves to one AddressValue, every absent part null; an address holding no place is null itself. It sits wherever a value slot may — at the top level, as an object's field, as a list's item.

Always a source: — the property's address (fact.property.address, stored whole), a row's address member (agent.address, off a row of fact.property.contacts, which edits the contact's stored address), a compute(), another address slot, the element inside a list's item, or fill.find({ brief, reads?, none? }). No model writes or picks an address, and an address declaring no origin is rejected at check time.

A find looks the address up: the one street address the reads write for the brief (with fact.property.uploads among them, the notes its documents carry), kept only when the address found has the same street number and street and the same postal code or city, the unit the documents wrote carried onto it; where they write none, the best match of one search around the home that the brief describes. Every part and the coordinates come from the lookup, and source is "resolved". A find fills a top-level address, an object's address field and a list of addresses; an address field inside a list's object item is never found.

Never a per-kind option. Which parts show is your render's (Slot.Address hands your markup the parts), and a partial line is a compute() over the value.

Its parts are members, read the way a row's are: place.city, place.latitude and every other part are legal as another slot's source: and in any reads, and an absent part reads null. Every one is read-only (where an edit goes). Nothing derived is a member: a compute() reading the address itself receives the whole value, and the address on one line is a formatting written there or in the Slot.Address render.

The editor edits an address as one value: its street, line 2, city, state and postal code as fields. Editing any part clears the coordinates, because a pin that no longer matches the text is worse than none, and an address without a pin is drawn as still to do. concrete dev has no address lookup, so its sidebar offers no suggestions and no pin map; the slot's coordinates come from its fixture.

Example

import { address, compute, fact, object, text } from "@homepages/concrete";

const place = address({ label: "Address", source: fact.property.address });

export const location = object({
  label: compute(() => "Location"),
  fields: {
    place,
    city: text.short({ label: "City", source: place.city }),
    line: text.medium({
      label: "Address line",
      source: compute({ reads: [place] }, (home) =>
        home == null ? "" : [home.street, home.city, home.state].filter((part) => part !== null).join(", "),
      ),
    }),
  },
});

Rules that apply

contract/row-rule, contract/source.

image

Signature

import { fact, image } from "@homepages/concrete";

const photo = image({
  label: "Hero photo",
  from: fact.property.property_media,
  crop: { mode: "locked", aspect: 3 / 2, aspectLabel: "3:2" },
});

Parameters

from is the list the image is picked from: fact.property.property_media for the property's photos, fact.property.floor_plans for its plans, fact.property.uploads for every image it holds, or several of them in order, picked from as their union. Omitted, the slot owns its image — the user uploads or pastes one into it. A list's plain item is item: image() when the list is bound, item: image({ from: fact.property.property_media }) when it is not. process: [process.cutout()] removes the background from every asset that becomes the value, producing its "cutout", "mask_white" and "mask_black" renditions; a slot picking from a list that already declares it — the floor plans do — declares nothing. crop is the asset's contract, not a rendered box. mode picks the cropper's behavior — "locked" keeps aspect, "free" resizes any edge — and aspectLabel is the cropper's pill text. Omitted, the cropper is free form: a crop follows only the aspect a slot declares, never the box the editor shows it in. mobile declares a second cut for narrow viewports: { aspect, breakpoint }, where breakpoint is a viewport width, the only thing a responsive source can switch on.

Constraints

Always one image. The resolved value is one ImageValue, never a list, so the builder carries no count bounds — a list of them does.

Always your own classes for the rendered box. The crop is baked into the served asset, and the framework applies no framing math of its own.

Never a crop you expect to paint anything. It tells the cropper what to cut and tells the renderer which cut a viewport is served.

Never a from or a process: [...] on a bound image: either beside a fact binding is a compile error. Beside a mirror or a compute(), either throws when the section is declared.

A fill here is fill.pick, which picks one image out of its candidates — the property's photos with from: fact.property.property_media, its plans with from: fact.property.floor_plans — and takes brief, reads and unique. A pick that names no from is a compile error. Inside a list's item over a media list, the element binds it. A contact's image fields are bound, not filled: source: contact.logo_dark, a member of a row of the contacts table. A compute() may also source an image: it returns an image record it read — a unit's floor plan, another section's photo — or null, and the slot stores the record as its reference.

Example

import { fact, fill, image, process, row } from "@homepages/concrete";

const mark = image({
  label: "Builder mark",
  from: fact.property.uploads,
  process: [process.cutout()],
  source: fill.pick({
    brief: "The builder's or developer's own mark among the uploads. When no upload is a builder's mark, pick nothing.",
  }),
});

const contact = row({ label: "Contact", from: fact.property.contacts, locked: true });
const contactLogo = image({ label: "Contact logo", source: contact.logo_dark });

Rules that apply

contract/sources, render/broken-image.

video

Signature

import { fact, video } from "@homepages/concrete";

const clip = video({
  label: "Property video",
  from: fact.property.property_media,
  playback: { controls: true },
});

Parameters

playback configures the renderer's video element — autoplay, loop, muted, controls, playsinline, and preload as a bandwidth lever.

A video slot takes an uploaded clip or a pasted provider link alike: a link's kind is its provider's, so nothing is declared for it. A link honours playback as far as its player allows.

from names the list the user picks a video from — fact.property.property_media for the property's videos, fact.property.uploads for every video it holds. Omitted, the slot owns its video.

Constraints

Always muted beside autoplay: every browser blocks unmuted autoplay, and check time is what enforces it.

Never a sources: no media builder takes one, and concrete check refuses it on any slot.

Never a crop: a video is selected, never re-edited. The box it plays in is your own classes.

A fill here is fill.pick, which picks one video out of the videos of its from, and takes brief, reads and none.

Never a from on a bound video, and never a process: [...]: no process applies to a video.

Example

import { fact, fill, video } from "@homepages/concrete";

const tourClip = video({
  label: "Walkthrough clip",
  from: fact.property.property_media,
  playback: { autoplay: true, muted: true, loop: true, preload: "none" },
  source: fill.pick({ brief: "The full walkthrough, not a single-room clip." }),
});

Rules that apply

contract/sources, sections/schema-invalid.

tour

Signature

import { fact, tour } from "@homepages/concrete";

const walkthrough = tour({ label: "3D tour", from: fact.property.property_media });

Constraints

Always the whole surface in the head and from. A tour has no type-specific option at all — no crop (it is selected, never edited), no playback (an iframe embed honors none), and no accepts (which providers are admitted widens in the link-provider catalog, never on a slot).

Always your own classes for the embed box.

Renders three ways from one selection: the embed, the tour's thumbnail as an image, or both.

A fill here is fill.pick, which picks one tour out of the tours of its from — fact.property.property_media for the property's tours — and takes brief, reads and none.

Never a from on a bound tour.

Example

import { fact, fill, Section, section, Slot, tour } from "@homepages/concrete";

export const Walkthrough = section(
  {
    key: "walkthrough",
    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} />
      <Slot.Tour slot={slot.tour} />
    </Section>
  ),
);

Rules that apply

contract/sources, sections/schema-invalid, render/unresolved-media.

document

Signature

import { document, fact, fill } from "@homepages/concrete";

const brochure = document({
  label: "Offering brochure",
  from: fact.property.uploads,
  source: fill.pick({ brief: "The full property brochure. When no upload is a brochure, pick nothing." }),
});

Constraints

Always a platform-hosted file — a pdf, spreadsheet or office file the visitor opens or downloads. The value resolves to one DocumentValue, rendered three ways over the same slot: a link to the file with Slot.Download, a PDF embedded in place with Slot.Document, or its first page as a still with Slot.Image.

Always a fill.pick in practice: no catalog field holds a document, so there is no fact to bind, and a slot declaring no origin is rejected. The pick chooses one document out of the documents of its from — fact.property.uploads, every document stored on the property — and takes brief, reads and none. A list of documents picks the same way, item: document({ from: fact.property.uploads }).

Never a per-kind option. A document is served as uploaded — never cropped, transcoded or re-encoded — so there is nothing to configure, and which file types may be attached is the upload gate's business rather than a per-slot lever.

Example

import { document, fact, fill, list } from "@homepages/concrete";

const disclosures = list({
  label: "Disclosures",
  min: 1,
  max: 8,
  source: fill.pick({ brief: "Every disclosure document." }),
  item: document({ from: fact.property.uploads }),
});

Rules that apply

contract/list-fill, contract/sources, sections/schema-invalid.

media

Signature

import { fact, fill, media } from "@homepages/concrete";

const feature = media({
  label: "Photo or video",
  kinds: ["image", "video"],
  from: fact.property.property_media,
  source: fill.pick({ brief: "The one asset that sells the kitchen." }),
});

Constraints

Always one asset whose kind is left open among kinds — an image, a video, a tour or a document; kinds omitted holds all four. Its value is that asset's own kind's value carrying kind ("image", "video", …), typed to the kinds you declare.

Never a Slot.Media. Narrow on kind and hand the narrowed value to that kind's own primitive — value?.kind === "video" && <Slot.Video slot={{ ...slot.feature, value }} />. Slot.Image takes the slot un-narrowed and draws whatever it holds: the image, a video's or tour's poster, a document's first page.

Never a per-kind option. No crop or playback: each holds for one kind and means nothing for the next. A video in it plays as a plain controls player and may be an upload or a pasted link.

A fill here is fill.pick, which picks one asset of the declared kinds out of its from and takes brief, reads and none. Without from, the slot owns its asset: the user uploads or pastes one of its kinds into it.

Example

import { fact, fill, media, Section, section, Slot } from "@homepages/concrete";

export const Feature = section(
  {
    key: "feature",
    label: "Feature",
    slots: {
      feature: media({
        label: "Photo or video",
        kinds: ["image", "video"],
        from: fact.property.property_media,
        source: fill.pick({ brief: "The one asset that sells the kitchen." }),
      }),
    },
  },
  ({ slot }) => {
    const { value } = slot.feature;
    return (
      <Section>
        {value?.kind === "video" ? (
          <Slot.Video slot={{ ...slot.feature, value }} className="aspect-video w-full" />
        ) : (
          <Slot.Image slot={slot.feature} className="aspect-video w-full" />
        )}
      </Section>
    );
  },
);

Rules that apply

contract/sources, sections/schema-invalid, render/unresolved-media.

process

Signature

import { fact, image, process } from "@homepages/concrete";

const plan = image({
  label: "Floor plan",
  from: fact.property.uploads,
  crop: { mode: "locked", aspect: 4 / 3 },
  process: [process.autocrop({ brief: "The plan drawing alone, without the title block." }), process.cutout()],
});

Parameters

process builds what a media slot's process: [...] lists — each one run on every asset that becomes the slot's value. process.cutout() removes an image's background, producing the "cutout", "mask_white" and "mask_black" renditions beside the original; it takes no options. process.autocrop({ brief }) crops an image to its subject as brief directs, at the aspect the slot's crop locks — free form where it locks none. Each returns the object the platform runs (CutoutProcess, AutocropProcess; either is a HolderProcess).

Constraints

Only a process that applies to the builder's kind: video({ process: [process.cutout()] }) is a compile error.

Always a brief on process.autocrop, and nothing else: an aspect is the slot's crop, and a process takes no reads — it is about one asset, never the property.

Each process once. A slot listing one twice throws when it is declared; the order of a slot's processes means nothing.

Declared where an asset first lands. A slot picking from a list that already declares the process — fact.property.floor_plans declares process.cutout() — reads the result and declares nothing.

Never a filter. A process says what becomes of an asset, never which assets are candidates: those are the slot's from, and a subset of them is a compute() reading one of the sorted lists.

Never beside a source that derives the value. A media slot bound to a fact holds what its fact holds, processed where that fact declares it: a process: [...] beside the binding is a compile error, and beside a compute() it throws when the section is declared. A fill.pick is no derivation — a picked slot processes what it lands.

Example

import { compute, fact, fill, image, list, process, text } from "@homepages/concrete";

const cover = image({
  label: "Cover photo",
  from: fact.property.property_media,
  source: fill.pick({ brief: "The strongest exterior, in daylight." }),
});

const mark = image({
  label: "Builder mark",
  from: fact.property.uploads,
  process: [process.cutout()],
  source: fill.pick({ brief: "The builder's own mark. When no upload is one, pick nothing." }),
});

const gallery = list({
  label: "Photos",
  max: 12,
  source: fill.pick({ brief: "The strongest photos, no two of one room." }),
  item: image({ from: fact.property.property_media }),
});

const photoCount = text.short({
  label: "Photo count",
  cap: 20,
  source: compute({ reads: [fact.property.property_media] }, (media) =>
    String(media.filter((asset) => asset.kind === "image").length),
  ),
});

Rules that apply

contract/sources.

poi

Signature

import { poi } from "@homepages/concrete";

const station = poi({ label: "Nearest station", placeholder: "Search places…" });

Constraints

Always one platform-built place, picked in the editor's place search. The platform owns the row's content, so there is nothing to configure beyond the head.

Never a source on the slot itself: no catalog field carries a place, and the model does not produce one. A list of them is sourced by fill.find, and the platform's place lookup supplies each row; its fill takes brief, reads and none, and the list's max bounds how many places it holds.

Usable standalone or as a list item.

Example

import { fact, fill, list, poi } from "@homepages/concrete";

const nearby = list({
  label: "Restaurants",
  max: 6,
  source: fill.find({ reads: [fact.property.uploads], brief: "Walkable, well-reviewed places to eat." }),
  item: poi(),
});

Rules that apply

contract/poi-curation, contract/count-bounds.

list

Signature

import { fact, image, list, object, row, text } from "@homepages/concrete";

const features = list({
  label: "Features",
  min: 3,
  max: 8,
  item: text.short({ label: "Feature", cap: 80 }),
});

const units = list({
  label: "Units",
  source: fact.property.units,
  item: (el) => {
    const unit = row({ label: "Unit", from: fact.property.units, source: el });
    const name = text.medium({ label: "Unit name", cap: 40, source: unit.label });
    return object({
      label: name,
      fields: {
        unit,
        name,
        plans: list({ label: "Floor plans", source: unit.floor_plans, item: image() }),
      },
    });
  },
});

Parameters

list({ label, source?, item?, min?, max?, … }) is the one multi-item kind, and a list is a table: its source decides which elements it holds and in what order, and its item what each item is made of. Either takes the head options.

source is any list:

  • A table — fact.property.units, .commercial_spaces, .contacts or .comparables. Every row, live, and the list IS that table in the content: adding, removing and reordering items edit the table. A unit's members are its label, beds, baths, sqft, price (text, so it may read "Sold"), floor (text, as printed: "PH", "3 to 4"), hoa_monthly, parking, lot_sqft, amenities, floor_plans and photos. A commercial space — a shop, office or restaurant a mixed-use building presents beside its units — is a row of its own table, never a unit: its members are its label (its printed name, "Suite 200"), use (text, as printed: "Retail", "Office"), sqft, price (text: "$45/SF/yr", "Leased"), floor, parking, amenities, floor_plans and photos. Any member may be unanswered, so a section that reads one renders its absence, and a property with no commercial space holds an empty table.
  • Another list slot — a sibling's const, or another section's Deck.slots.selected. Its items are that list's elements.
  • A list-valued member of a row — unit.floor_plans, unit.photos, or unit.amenities, whose item is a short text holding each value (item: text.short({ cap: 40 })) — inside an item that declares the row.
  • A compute() returning a list.
  • A fill — fill.pick({ brief }) picks the elements out of its item's candidates: a table, the media of the item's kind in the item's from, or a select's keys; fill.write({ brief }) writes them, each of the item's kind; fill.find({ brief }) finds places or addresses.

With no source, the user builds the list. The property's media lists are never a list's source: a list of the property's media is picked out of one, which its item names as its from (source: fill.pick({ brief }), item: image({ from: fact.property.property_media })).

item decides each item's shape:

  • A function of the element — item: (el) => object({ … }) declares a row from the element (row({ label, from, source: el }), its from the list's table) and the fields that read it, or item: (key) => select({ label, from, source: key }) a value slot reading the element whole. The function is called once, when the section is declared, with a typed reference to one element.
  • A plain slot — item: image(), item: text.short({ cap: 80 }). The item is the element itself, at that kind. A written list states its kind here, and the media item of a list bound to no fact states its from (item: image({ from: fact.property.property_media })). A list fill.pick sources takes a plain item, never a function: a primitive that holds candidates itself — a media slot, a row or a select — or an object() exactly one field of which is one and states no source — the pick's candidates, which the other fields read by its const.
  • Absent — the items are the elements themselves. A picked list's item is never absent; one whose item is a row({ label, from }) is a selection: its value is the rows' identities.

min and max bound the item count, whatever the source.

Where a list's membership and order are written follows from its source, as a value slot's edit does (where an edit goes): a list sourced by a table edits the table.

Constraints

Always one primitive for everything multi-item: there is no second list builder.

Always fixed depth. An item is never a list, an object's field is never an object or a list of rows, and a field-level list holds a value item or an object whose own fields hold no list of objects — a list of objects nests one level. Each violation throws when the section is declared, naming the list.

Always the fill on the list's source:, never on its item: one fill produces the whole list, so a value item that declares one throws, naming the slot. The fields of an object item do carry their own, and a pick among them never repeats an element across the items.

Always a max on a list a fill sources: a fill is an open supply. Always an item on a list a fill.write sources — a value slot, or an object exactly one field of which holds the element (question: text.medium({ cap: 48, source: el })): a write has no candidates, so the item is where its kind is declared. A pick's item is where its candidates are declared, so it is never absent.

Always an origin on every field of an object item — the element, a row's member, a fill or a compute(). A property fact is the same value in every item, so it is never an item field's source:; it goes in the reads of the field's fill or compute().

Never an element outside its own list's item. An element reference read by another list's item throws when the section is declared.

Never the removed options. fields is an item function returning an object(), title the object's label, count the list's min and max, unique the pick's own (fill.pick({ unique: false }) lifts it) — each throws, naming the replacement.

Example

import { fact, fill, image, list, number, object, row, select, text } from "@homepages/concrete";

const EMPHASIS = ["regular", "highlight"] as const;

const comp = row({ label: "Comparable", from: fact.property.comparables });

const comps = list({
  label: "Comparable sales",
  min: 3,
  max: 6,
  source: fill.pick({ brief: "The nearest sold comparables, closest first." }),
  item: object({
    label: comp.address.street,
    fields: {
      comp,
      price: number({ label: "Price", thousandsSep: true, source: comp.price }),
      emphasis: select({
        label: "Emphasis",
        from: EMPHASIS,
        source: fill.pick({ reads: [comp.distance_m, comp.sale_date], unique: false, brief: "Highlight the closest, most recent sales." }),
      }),
    },
  }),
});

const rooms = list({
  label: "Rooms",
  min: 2,
  max: 4,
  source: fill.write({
    reads: [fact.property.uploads, fact.property.description],
    brief: "The rooms the property's photos actually show, as Title Case room names.",
  }),
  item: text.short({ cap: 40 }),
});

const photo = image({ label: "Photo", from: fact.property.property_media });

const slides = list({
  label: "Slides",
  min: 3,
  max: 8,
  source: fill.pick({ brief: "The rooms that sell this home, exterior first, no two of one room." }),
  item: object({
    label: text.short({ cap: 80, source: fill.write({ reads: [fact.property.description, photo], brief: "Name what the photo shows." }) }),
    fields: { photo },
  }),
});

const shown = list({
  label: "Shown comparables",
  max: 4,
  source: fill.pick({ brief: "The four sales a buyer would compare this home with." }),
  item: row({ label: "Comparable", from: fact.property.comparables }),
});

const rivals = list({
  label: "Competing listings",
  source: shown,
  item: (el) => {
    const rival = row({ label: "Comparable", from: fact.property.comparables, source: el, locked: true });
    return object({ fields: { rival, listed: text.short({ label: "Listed", source: rival.listed_date }) } });
  },
});

Rules that apply

contract/list-source, contract/list-scalar, contract/list-fill, contract/fill-verb, contract/nested-slot-types, contract/record-collection, contract/count-bounds.

object

Signature

import { compute, fact, object, row, text } from "@homepages/concrete";

// A label from a source: a constant, stored as the locked field `label`.
const 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 }),
  },
});

// A label naming one of the fields: the card's title is that field, which the user edits.
const agent = row({ label: "Agent", from: fact.property.contacts });
const name = text.short({ label: "Name", source: agent.name });

const contact = object({
  label: name,
  fields: {
    agent,
    name,
    phone: text.short({ label: "Phone", source: agent.phone }),
  },
});

Parameters

object({ label?, fields, locked?, when? }) groups fields that belong together into one card — at a section's top level, and as a list's item alike.

label is the card's title, and takes one of two forms.

  • A source — what a text slot's source: takes: a fact, a row's member, the list's element, another section's slot or a compute() — or a written label, text.short({ cap: 60, source: fill.write({ reads, brief }) }), a text slot whose kind and cap are what the write produces. A constant title is compute(() => "Property address"). The label is stored as a locked text field keyed label, so render code reads it off the object's binding as .label and nobody edits it — the comparable's address titling its card, a written caption titling a photo's.
  • One of the object's own fields, named by its const — label: name, with name among the fields. The label is stored as a pointer to that field, { field: "name" }, and adds no field of its own: render code reads the field, and the card's header follows it as the user edits it. A text field is the only kind a label may name.

A title the user edits is always the second form: a label from a source is locked.

fields holds value slots, rows, lists of value slots and lists of objects, each stating its own label. A field reads a row beside it by that row's members. A top-level object's field is read by the const it was declared as, like any sibling slot (sources), so slots that read each other can share a card. Another section reads it through the object's ref, which hands out one ref per field: Hero.slots.agent.fields.contact.

An object holds no value of its own: its value is its fields' values. An item of a list of objects carries its identity, id, beside them — the row's id in a list over a table, the one the platform mints otherwise (value shapes).

Its card renders through one Slot.Object over the object's binding — the top-level object's own, or one item from bindItems — and each field renders inside it through its own binding, read straight off the object's: slot.address.street, item.price.

Constraints

Always at least one field, and a label on every field.

Never a source on the object: it is a pure container, so it throws, naming the field that should hold the value instead.

Never a field keyed label: the key is reserved for the object's own label, so write its source as label, beside fields.

Never a field named like one of its binding's own keys — id, slot, index, def, value or present. A field is read straight off the object's binding, so a field named value would answer the binding's own value instead; the name is a compile error, and concrete check refuses it by name.

Never a string or a text slot built in place as the label: a string is compute(() => "…"), and a title the user edits is a field the label names. A label naming a slot that is none of the object's fields, or a field that is not text, throws when the section is declared.

Never an object inside an object or a list of rows as a field. Identity is a flat (instance, slot, item, field), and a nested object has no place in it.

A list of objects as a field nests one level and is one field: a click on any of its items selects that field of the card, and each item carries its own id, which stays the same across re-bakes. Its items list a row's list-valued member (a unit's floor plans), a compute(), or authored items; each item field reads the element, a row declared beside it, or nothing. Authored items need a card nothing sources — a top-level object, or an item of a list the user builds: every field of a sourced list's item owes an origin, so there a nested list with no source is refused at check time. Never a fill, a fact table or another list slot as its source, never a fill or a compute() on its item fields, and never a list of objects inside its item — each throws when the section is declared; declare that list at the top level instead.

A fill sits on a field, never on the object. Each field states its own origin, and an object's text fields are written, its selects picked, one decision per field.

Always every unlocked field of the object rendered inside its own Slot.Object: a field marked outside it is render/group-ancestry, and a top-level object's field rendered nowhere is render/missing-slot-marker.

Example

import { fact, fill, list, object, select, text } from "@homepages/concrete";

const ICONS = ["star", "leaf", "wave"] as const;

const amenities = list({
  label: "Amenity cards",
  max: 6,
  source: fill.write({ reads: [fact.property.description], brief: "The amenities, each named in a few words." }),
  item: (title) =>
    object({
      label: title,
      fields: {
        icon: select({ label: "Icon", from: ICONS, source: fill.pick({ reads: [title], unique: false, brief: "The icon that fits the amenity." }) }),
        description: text.long({
          label: "Description",
          cap: 200,
          source: fill.write({ reads: [fact.property.description, title], brief: "Describe the amenity in two sentences." }),
        }),
      },
    }),
});

Rules that apply

contract/object, contract/nested-slot-types, contract/row-fill, render/group-ancestry.

row

Signature

import { fact, row, text } from "@homepages/concrete";

const agent = row({ label: "Agent", from: fact.property.contacts });

const phone = text.short({ label: "Phone", source: agent.phone });

Parameters

row({ label, from, source?, locked?, when? }) holds one row of a table. from names the table — fact.property.contacts — which is the row's type, its members being that table's, and the set it is picked from. Its value is that row's identity, or null when it holds none; the editor shows it as a bar the user re-picks the row from.

from may name several tables in order — from: [fact.property.units, fact.property.comparables] — and the row is a row of any of them, picked from their union; from: t and from: [t] are one declaration. Each table is named once, and the row reads only the members every one of them carries, at one kind: reading any other throws when the section is declared.

source says which row, and yields a row of from's table:

  • Absent — the table's first row: row({ label, from: fact.property.contacts }) holds the primary contact.
  • The element, inside a list's item — row({ label, from, source: el }) holds the item's own row, from restating the list's table.
  • A list or row slot — a sibling's const, or another section's slot. A list gives its first item; another section's row is mirrored — through its object's field ref, Hero.slots.agent.fields.contact, when the row is an object's field.
  • A compute() returning one row's identity, or null.
  • A fill.pick({ brief }) — the model picks the row out of from.

The value row() returns also reads the element's members: agent.phone is a member reference, legal as a slot's source: (where its edit goes) and in any reads. A list-valued member (unit.floor_plans, unit.amenities) is a list's source.

locked: true hides the row's bar; its readers still read it.

Constraints

Always a from, and always a table or a list of tables: a table is never a row's source.

Always the only way to read a member. A table, a list or a pick hands out no member of its own, and a table read by position does not exist: declare a row, then read its member.

Always read where it is in scope: as a field of the same object, at the section's top level, or as a field of a top-level object, which any slot of the section may read from outside the object. A row inside a list's item is read only within that item; a member read off a row its reader cannot see throws when the section is declared.

Never a read of one of the row's own keys — its label, from, source, locked and when, and its type — that its table has no member named: agent.source is the row's source, never a member. A table member of that name wins, so a unit's label is unit.label. A slot that reads one throws when the section is declared, naming the row and the key.

Never a fill.write or a fill.find: a row holds a row that exists, which only a pick out of its from yields.

What the section renders of a row is its readers. A row among an object's fields owes the canvas no marker: it is the object card's bar, in the editor sidebar. A row among the section's own slots is a card of its own, which concrete check asks a marker for and no primitive renders, so hold it in an object — or lock it. A row held in an object is still read by the slots outside it, and still mirrored by other sections, so a row the whole page shares can stay re-pickable.

Example

import { compute, fact, fill, number, object, row, Section, section, Slot, text } from "@homepages/concrete";

const broker = row({ label: "Broker", from: fact.property.contacts });

const featured = row({
  label: "Featured sale",
  from: fact.property.comparables,
  source: fill.pick({ brief: "The sale closest to this home in size and location." }),
});


export const Contact = section(
  {
    key: "contact",
    label: "Contact",
    slots: {
      agency: object({
        label: compute(() => "Broker"),
        fields: { broker, phone: text.short({ label: "Broker phone", source: broker.phone }) },
      }),
      sale: object({
        label: compute(() => "Featured sale"),
        fields: {
          featured,
          price: number({ label: "Featured price", thousandsSep: true, source: featured.price }),
        },
      }),
    },
  },
  ({ slot }) => (
    <Section>
      <Slot.Object slot={slot.agency} as="p">
        <Slot.Text slot={slot.agency.phone} as="span" />
      </Slot.Object>
      <Slot.Object slot={slot.sale} as="p">
        <Slot.Number slot={slot.sale.price} as="span" />
      </Slot.Object>
    </Section>
  ),
);

Rules that apply

contract/row-source, contract/row-rule, contract/fill-verb.

See also

sources for where a bound value comes from, fill for what the model produces, value shapes for what each kind holds at render, and Slots for why a slot is a type crossed with a source.