Concrete
GuidesPreview your work

Add a sample property

You need a second property to render against — a rental, a multi-unit building, a listing with almost no media.

Goal

A second property in your workspace, and a fixture that renders your template against it.

Prerequisites

  • The workspace Start leaves you with, which already carries one property under fixtures/properties/starter/.
  • Fixtures for what a property document is and why it is spelled the way the platform stores a listing.

Steps

See what the library has

npx concrete property list

One line per property: its slug, what it is, then its listing intent and the media it carries.

rental-apartment  A furnished studio for rent in a vintage brick building in Royal Oak, Michigan. (for_rent, 1 unit, 17 photos, 1 floor plan, 1 video, 1 tour)
sparse-listing    A sparse single-family listing in Miami: nine uncaptioned phone photos, one sentence. (for_sale, 1 unit, 9 photos)
starter           A small, generic single-family home for sale, with one of every fact and media kind. (for_sale, 1 unit, 6 photos, 1 floor plan, 2 videos, 1 tour, 1 document)

The counts are the point. Pick the property that puts your template under the pressure you want to see: a listing with nine phone photos and no exterior shot, a rental where the price is monthly, a building with eleven units.

Copy one in

npx concrete property add rental-apartment

The whole folder lands at fixtures/properties/rental-apartment/ — beside the fixture list template.ts names — holding the property document property.json, its media/, a README describing it and a sources.json recording where each file came from. From that moment it is yours: nothing was added to package.json, so no later release of the library can change what you copied, and an existing folder of that name is refused rather than overwritten.

The command ends by printing how to list the property and the content fixture to make on it:

Copied fixtures/properties/rental-apartment/ from @homepages/sample-properties 0.3.0. It is yours now: edit it freely.
List it: add "properties/rental-apartment/property.json" to the "properties" list in fixtures/index.json.
Make a fixture on it: a content fixture beside fixtures/index.json, say fixtures/rental-apartment.json, named by its file name,

  { "property": "properties/rental-apartment/property.json" }

and add "rental-apartment.json" to the "fixtures" list in fixtures/index.json.

Point a fixture at it

A property document names each upload by an id, and a content fixture picks its media by that id — { "media": "living-room" }. Given the starter's hero:

import { fact, fill, image, section, text } 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: "Name 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." }),
      }),
    },
  },
  () => null,
);

the fixture is:

fixtures/studio-rental.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/rental-apartment/property.json",
  "content": {
    "hero-1": {
      "slots": {
        "headline": "A furnished Royal Oak studio, Juliet balcony and all",
        "hero_image": { "media": "living-room" }
      }
    }
  }
}

and the property and the fixture each one more entry in the list:

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

The file name is the fixture id — rename studio-rental.json and you have renamed the fixture. The media you pick must be an upload of this fixture's property: a photo of the starter property is fixtures/media-not-in-property, named at the entry.

Edit it

The copy is ordinary data, spelled the way the platform stores a listing: change a unit's price, take the tour out of uploads, delete half the photos — whatever produces the state you want to design against. Name $schema as ../../../.concrete/schema/property.schema.json and your editor checks each edit. There is no builder and no derivation, and no property spreads another, so a variation is a copy of the folder, edited — not a transform of this one.

Verify

concrete dev lists every fixture in the picker, each with a one-line summary of its property — Studio rental (Condo townhome, for rent, 1 unit, 17 photos) — so switching between them re-renders the whole canvas under the new property.

concrete check then grades your template against all of them: a property that fails the platform's own schema is fixtures/property-invalid, and a workspace whose fixture list names no fixture at all has nothing to grade (fixtures/none).

On this page