Concrete
Concepts

Fixtures

Previewing and checking — what your template renders against before a real property exists, and why none of it can ship.

What it is

A fixture is one property plus a content layer: the facts a listing would carry, and what a fill would have written on top of them. It is what concrete dev renders and what concrete check grades your template against.

A fixture is two documents: a content fixture, and the property document it is on. The section below is the starter's hero, shortened:

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

export const Hero = section(
  {
    key: "hero",
    label: "Hero",
    slots: {
      headline: text.medium({
        label: "Headline",
        cap: 60,
        source: fill.write({ reads: [fact.property.description], brief: "What makes the property worth seeing. Write one sentence. Confident and specific." }),
      }),
      hero_image: image({
        label: "Hero image",
        from: fact.property.property_media,
        source: fill.pick({ brief: "The photo that best shows the front." }),
      }),
    },
  },
  ({ slot }) => (
    <Section>
      <Slot.Text slot={slot.headline} as="h1" />
      <Slot.Image slot={slot.hero_image} />
    </Section>
  ),
);

and this is a content fixture over it:

fixtures/starter-home.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/starter/property.json",
  "content": {
    "hero-1": {
      "slots": {
        "headline": "A brick colonial on a quiet, tree-lined street",
        "hero_image": { "media": "exterior-front" }
      }
    }
  }
}

template.ts names the fixture list, fixtures: "./fixtures/index.json", and the list names every property, then every content fixture, each in the order the playground offers them:

fixtures/index.json
{
  "$schema": "../.concrete/schema/fixture-list.schema.json",
  "properties": ["properties/starter/property.json"],
  "fixtures": ["starter-home.json"]
}

Fixtures are data: JSON documents nothing evaluates, found through the list template.ts names and never by where they sit. template.ts is the only file the framework finds by name, and nothing the list reaches ever reaches a published bundle.

Why it works this way

A template is a function of data it will not see until a customer uploads it. Without a stand-in you cannot look at your work, and a stand-in that disagrees with the real thing is worse than none — it green-lights markup that breaks on the first real listing.

So a fixture is deliberately not a mock. The property is the platform's own facts shape, validated with the platform's own schema. And the content layer is resolved by the platform's own code: the same bake that a real fill runs over canonical facts, and the same pass that settles every slot reading another section once the fills are done. One bake — a fixture can never disagree with a fill about what a fact-bound slot holds, because there is only one implementation of the answer.

That leaves one hazard: dev data that follows you into production. Your own photographs, a colleague's phone number, a sample listing's price — none of it belongs in an artifact a customer's site loads. A convention would not be enough, because the way it fails is an innocent import three modules deep. So the separation is structural, and concrete check reads the actual import graph.

How it works

Discovery is the list. template.ts names one fixture list, and the list names the properties and the content fixtures, each a path relative to the list. Every fixture has one name: a content fixture's is its file name — starter-home — and a property's is its folder's — starter. The playground lists them by it and its address says it, so renaming one is renaming its file or folder. A property is listed whether or not a content fixture is on it, and every property a listed content fixture is on must be listed. Nothing else is loaded: a file the list does not name is not a fixture, wherever it sits. Every path a document states is relative to that document and stays inside its own folder, so a property's folder holds everything the property is. That folder is the property's alone: it holds no list, no content fixture and no other property.

A property is a document beside its media.

fixtures/properties/starter/property.json
{
  "$schema": "../../../.concrete/schema/property.schema.json",
  "address": { "street": "27 Linden Lane", "city": "Ashland", "state": "OR", "postal": "97520", "latitude": 42.1946, "longitude": -122.7095 },
  "listing_intent": "for_sale",
  "description": "A three-bedroom colonial on a quiet, tree-lined street.",
  "uploads": [
    {
      "id": "exterior-front",
      "kind": "image",
      "file": "media/exterior-front.jpg",
      "account": "A rendering of the front of a building, seen from the street. The building rises three storeys of pale blue horizontal siding with white trim. …"
    },
    { "id": "plan", "kind": "image", "file": "media/plan.png" }
  ],
  "property_media": [{ "media": "exterior-front" }],
  "floor_plans": [{ "media": "plan" }],
  "units": [
    { "id": "unit_01", "label": null, "beds": 3, "baths": 2, "sqft": 1850, "price": "625000", "floor_plans": [{ "image": { "media": "plan" }, "floor": "Main Floor" }] }
  ],
  "contacts": [
    {
      "id": "jordan-avery",
      "name": "Jordan Avery",
      "title": "Listing Agent",
      "org_name": "Linden Realty",
      "bio": null,
      "email": "jordan@linden-realty.example.invalid",
      "phone": "(541) 555-0142",
      "address": null,
      "website": null,
      "headshot": "media/headshot.jpg",
      "logo_dark": null,
      "logo_light": null,
      "instagram": null,
      "linkedin": null,
      "x": null,
      "facebook": null
    }
  ],
  "comparables": [
    {
      "id": "comp-1",
      "address": { "street": "31 Linden Lane", "city": "Ashland", "state": "OR", "postal": "97520", "latitude": 42.1949, "longitude": -122.7101 },
      "price": 612000,
      "sale_date": "2026-04-18",
      "beds": 3,
      "baths": 2,
      "sqft": 1790
    }
  ]
}

The property is spelled the way the platform stores a listing's facts, member for member. Every file the seller uploaded is one entry of one uploads list, in the order they were added, and each entry says what kind it is — "image", "video", "tour" or "document" — and names its file by a path relative to the document. What an upload is for is which list holds it: the property states property_media (the photos, videos and tours that show it), floor_plans (its plans) and property_documents as the platform has sorted them, each entry a pick of one of its uploads by id, { "media": "<upload id>" }, in the list's order — fact.property.property_media and fact.property.floor_plans read exactly what you state. One upload may sit in both, or in neither; a document sits in neither. Anything else that points at an upload picks it the same way: a unit's floor plans and its photos, and a content fixture's media slot. A unit states its floor, hoa_monthly, parking, lot_sqft, amenities and photos only when it has them; one left out loads unanswered, as a unit nobody filled it for holds it. What a row owns rather than picks — a contact's headshot and logos, a comparable's photo — names its file directly. Contacts rank by their order alone: a section showing a single contact shows the first.

What the platform derives is never stated, so it can never disagree with the platform: an address's one-line display and its street without the street type, and a comparable's standing (sold once it has a sale_date), its distance from the property and its price's period. Writing one is reported by concrete check. The schemas concrete dev writes to .concrete/schema/ — one each for the fixture list, a content fixture and a property — are what the documents' $schema lines name, so your editor completes and checks them as you type.

There is no builder, no derivation and no spreading one property into another. A second scenario is a second property: copy the folder and edit it, which keeps it visible, editable and diffable. Facts only: points of interest, amenities and unit copy are fill output, so they are stated in a content fixture rather than on the property.

A content fixture states what a fill would write, and only that. content is keyed by instance — the id the page probe gives a placement, <section key>-1, and -2 for a second placement of the same section — and each instance states its slots, and optionally enabled: false to switch it off and variant to choose a display case. concrete check grades every document against the template: an instance no page places, a slot its section does not declare or a value of the wrong kind is reported, at fixtures/document-invalid and fixtures/instance-not-placed. Media is stated as a pick of the property's own uploads, { "media": "<upload id>" }, with a crop beside it for a cropped image; a contact's image is { "media": "contact:<contact id>:headshot" }. A list, a row and an object are each stated by their own value: a row the identity of the row it holds, an object its fields, a list of objects its items. A list sourced by a table keeps the table's rows, so its entry states only the fields a fill writes onto them, item by item.

A slot a source decides — a fact, a row's member, a compute() — takes its value from the property. Stating one is stating the user's override of that source, so it counts only with its mark: the value in slots, and the slot (or <object>.<field>) set to true under slot_overrides.scalar, as the app marks an edit.

Leave content off entirely and you have the sparse-fill case: facts still bake, and every generative slot resolves to its empty value. That is the state a real site is in before the fill runs, and it is worth looking at.

Resolution is the platform's, in five steps. Files become ids and the property is validated; the page probe says which instances exist; each instance bakes its source-bound and computed slots from the canonical facts and takes the rest from the content entry; every slot reading another section settles, upstream first; and media resolves to served URLs under concrete dev and to content-addressed artifact assets under concrete build. The playground's inspector shows, per slot, which of those steps produced the value.

Sample properties are copied in, never depended on.

concrete property list           # the library: slug, description, type, counts
concrete property add starter    # copies the folder to properties/starter/ beside the fixture list

After the copy the property is yours — its property.json, its media/, its README and its sources, identical in shape to one you wrote by hand, and beyond the reach of any later version of the library. The command prints the content fixture to make on it; listing that fixture is yours to do. Your workspace never declares the library as a dependency.

The bundle rule is structural. No module reachable from template.ts may import a file the fixture list reaches, or the sample library. concrete check refuses, naming the importing file, at fixtures/reachable-from-bundle.

A workspace from before fixtures were data converts with concrete upgrade: the upgrade to this major evaluates each TypeScript fixture one last time and writes it out as documents, and a property made by spreading another becomes a copied property of its own.

What it is not

A fixture is not a test. It states data; it asserts nothing. What grades your template is concrete check, which renders every fixture and reports on the result.

It is not seed data either. Nothing writes a fixture to the platform, and the playground's edits stay in the browser: they are kept while you look at them, never written back to the documents. To keep an edit, make it in the document.

And it is not a per-section thing. One fixture covers the whole template, because a slot may read another section, and that read could not settle over a fragment.

Where next

Write a fixture, Add a sample property and Write an edge-state fixture — a bare property, an empty list, a page switched off — are one guide each, and Use the playground is where you look at what they resolve to. Fixtures states the three documents member by member; the commands are concrete property add and concrete property list; the fixture half of a report resolves at fixtures/none, fixtures/property-invalid and fixtures/media-not-in-property.

On this page