Concrete
GuidesDeclare slots

Add points of interest

The section has to show what is nearby — schools, transit, the coffee place — and none of it is on the property.

Goal

A neighbourhood section whose nearby places the platform finds with a place search around the home, and which a user can still re-pick by hand.

Prerequisites

  • The workspace Start leaves you with, and concrete dev running.
  • AI fill for what a fill is and who executes it.

Steps

1. Declare the list, one category at a time

A point of interest is its own slot kind because its value is a place row the platform builds — you configure nothing about it beyond the head. A poi on its own is one place the user searches for; a list of them is the found form:

sections/neighborhood.tsx
import { fact, fill, list, poi } from "@homepages/concrete";

const restaurants = list({
  label: "Restaurants",
  max: 3,
  source: fill.find({
    reads: [fact.property.uploads],
    brief: "The dining a buyer of this home would actually care about — walkable, characterful places a resident would take a guest. Favour standalone restaurants with a local reputation over chains and fast food.",
  }),
  item: poi({ label: "Restaurant", placeholder: "Search restaurants nearby…" }),
});

Declare one list per category you want on the page. A category is a search, and a search is a list: three lists of three beat one list of nine, because the brief for "restaurants" and the brief for "transit" are not the same sentence.

2. Understand where the places come from

fill.find is the third fill verb: the model neither writes the places nor picks them from anything the property holds. It plans one place search around the home, choosing the phrase and how far to look, and chooses among the results. The platform's place lookup supplies every stored field of each row — so a find names no candidate set.

reads is exactly what the model sees, here as everywhere. With fact.property.uploads in it, the model sees every upload as what is known about it, and the notes the uploaded documents carry ride along, both when it plans the search and when it chooses among the results. It aims the search so the places the documents name for this list's category would be among the results, and puts them first when they are. The documents are context and nothing more: a place they name that the search does not surface is simply not picked. Leave the read out only when the documents should never steer the list.

The same find fills a single place: poi({ label: "Clubhouse", source: fill.find({ reads: [fact.property.uploads], brief: "The HOA clubhouse." }) }) finds exactly one. A poi() with no source is picked by the user in the editor.

A find takes its brief, its reads and none — anything else on it is a compile error.

3. Understand what max means here

The lookup is what produces the items, so the list's max is a ceiling, and a full search fills toward it. Write the number the page should show: max: 3 and no min. A thin neighbourhood genuinely has fewer than three of something, and a floor would only be met with places nobody wants. A filled list declares max, and one without it is contract/fill-verb.

When a user may add more places than a fill should write, keep the larger max and state the target in the brief, since a find takes no count: brief: "At most 4: the dining a buyer of this home would actually care about."

4. Know when the list comes back empty

A find that finds nothing fills the list empty: no candidate, no place that fits the brief, only places the model invented, or a home with no coordinates to search around. A rural listing with no transit stop nearby has answered the question, so the fill records the empty list as an answer and the editor flags nothing. You do not write none for it; a find accepts none: true, and it changes nothing here. Whether a section of empty lists is still worth showing is its visibility rule's call.

A find is one lookup for one list, so a fill naming two slots — or naming a slot that is not a list of places — is contract/poi-curation. You cannot write that from a section: fill.find is a list's source, and its items are places, so declaring it on the list whose item is a poi is the whole of it.

5. Render the places as one card, not as editable items

A list whose item is a single slot is edited as one card — the editor has no per-place selection, and the user re-picks a place through the card's own search. So mark the container and render the places as plain elements:

sections/neighborhood.tsx
import { fact, fill, list, poi, Section, section, Slot } from "@homepages/concrete";

export const Neighborhood = section(
  {
    key: "neighborhood",
    label: "Neighborhood",
    slots: {
      restaurants: list({
        label: "Restaurants",
        max: 3,
        source: fill.find({ reads: [fact.property.uploads], brief: "Walkable places a resident would take a guest." }),
        item: poi({ label: "Restaurant" }),
      }),
    },
  },
  ({ slot }) => (
    <Section>
      <Slot.List slot={slot.restaurants} as="ul" className="flex flex-col gap-2">
        {slot.restaurants.value
          .filter((place) => place.name !== "")
          .map((place) => (
            <li key={place.id}>
              {place.name}
              {place.distance_m === null ? null : <span> · {Math.round(place.distance_m / 100) / 10} km</span>}
            </li>
          ))}
      </Slot.List>
    </Section>
  ),
);

A place is no object, so there is no per-item card to mark: Slot.Object accepts only an object's binding, and an item of this list is a compile error there. Filtering nameless places out is deliberate: dropping one reads better than printing a blank one, and the container keeps its marker either way.

6. Handle absence, because the provider omits most fields

Every field of a place row past distance_m is optional and never nullable: the places provider genuinely returns nothing for parks, schools and transit stops. Read PoiRow in the value shapes before you render a rating or an opening time, and treat a missing photo as this place has no image, not as an error. Where a photo is present, display its attribution with it — the provider requires it.

A row is stale by design. Ratings drift and businesses close; a row refreshes only when its deliverable is regenerated or a user re-picks the place.

7. State places in the fixture

A place row is a literal, not a media entry of the property — the lookup is what produces one, and a fixture stands in for the lookup:

fixtures/starter-home.json
{
  "$schema": "../.concrete/schema/content-fixture.schema.json",
  "property": "properties/starter/property.json",
  "content": {
    "neighborhood-1": {
      "slots": {
        "restaurants": [
          {
            "id": "poi-1",
            "place_id": "ChIJ-starter-1",
            "name": "Rose Street Kitchen",
            "address": "18 Rose Street",
            "lat": 40.7411,
            "lng": -73.9897,
            "distance_m": 320
          }
        ]
      }
    }
  }
}

neighborhood-1 is the section placed once, under its key neighborhood.

Write a second fixture with the list empty. A neighbourhood with nothing walkable is a real property, and the empty branch of this section is the one a check would otherwise only see synthesized.

Verify

Run concrete dev: the section paints your places, and selecting the list opens one card with the platform's place search in it — pick a different restaurant and the canvas updates.

Then run concrete check:

concrete check
concrete check passed: 13 stages.

On this page