Omnira Docs v1.0.0

Section reference › Real estate

Property comparison "type": "compare"

A side-by-side table comparing homes on price, size, rooms and more. Visitors pick homes with the compare button on property cards; until they do, the default homes are shown.

Example of the compare section
The example below, rendered with placeholder images.

Example#

Paste this into the sections list of a page file:

JSON
{
  "type": "compare",
  "eyebrow": "Compare",
  "title": "Compare homes side by side",
  "defaults": [
    "azure-bay-villa",
    "cedar-ridge-house"
  ],
  "items": [
    {
      "slug": "azure-bay-villa",
      "title": "Azure Bay Villa",
      "type": "Villa",
      "status": "For Sale",
      "price": 4250000,
      "city": "Miami",
      "address": "1420 Bayshore Drive",
      "beds": 5,
      "baths": 6,
      "area": 6200,
      "garage": 3,
      "year": 2021,
      "lot": "0.6 acres",
      "features": [
        "Infinity pool",
        "Private dock"
      ],
      "image": "placeholder"
    },
    {
      "slug": "hudson-loft",
      "title": "Hudson Street Loft",
      "type": "Apartment",
      "status": "For Rent",
      "price": 6800,
      "period": "/mo",
      "city": "New York",
      "address": "211 Hudson Street",
      "beds": 2,
      "baths": 2,
      "area": 1450,
      "year": 1928,
      "features": [
        "Doorman",
        "Roof terrace"
      ],
      "image": "placeholder"
    },
    {
      "slug": "cedar-ridge-house",
      "title": "Cedar Ridge House",
      "type": "House",
      "status": "For Sale",
      "price": 895000,
      "city": "Austin",
      "address": "88 Cedar Ridge Lane",
      "beds": 4,
      "baths": 3,
      "area": 2900,
      "garage": 2,
      "year": 2016,
      "lot": "0.3 acres",
      "features": [
        "Pool",
        "Home office"
      ],
      "image": "placeholder"
    }
  ]
}

Options#

OptionTypeDefaultDescription
eyebrowstring—Small label shown above the title.
titlestring—Section heading. Simple inline HTML such as <em> or <br> is allowed.
textstring—Short intro paragraph under the title.
headAlignstringcenterAlignment of the eyebrow/title/text block. Any value other than "center" (e.g. "start") left-aligns it.
Values: center | start
itemsarray—Every property that can be compared. In the real-estate demo: { "$data": "properties" } (all of them).
defaultsarraythe first 3 itemsSlugs of the homes shown before the visitor has picked any.

Also accepts the options every section accepts: id, tone, padding, fluid, class, hidden.

Fields of each entry in items#

OptionTypeDefaultDescription
slugstring—Unique id; the "View home" button links to property-<slug>.html.
titlestring—Property name.
addressstring—Street address.
citystring—City.
imagestring—Photo.
pricenumber—Price as a plain number, e.g. 895000 (shown as $895,000).
periodstring—Added after the price for rentals, e.g. "/mo".
statusstring—"For Sale" or "For Rent". Price per sqft is only shown for sales.
typestring—e.g. "House", "Apartment", "Villa".
bedsnumber—Bedrooms.
bathsnumber—Bathrooms.
areanumber—Living area in sqft. Required.
garagenumber—Garage spaces.
yearnumber—Year built.
lotstring—Lot size, e.g. "0.3 acres".
featuresarray—Feature list; the Pool row shows a tick if any feature contains "pool".

Tips#

  • In the real-estate demo use "items": { "$data": "properties" } so every home can be compared; the table then only shows the ones the visitor picked (saved in their browser, up to 4).
  • Every item needs a numeric "area", otherwise the build stops with an error.
  • The compare buttons that add homes live on property cards (the properties section) and on property detail pages.

Where it's used#

Open these pages in template/ to see it working:

  • Real Estate: template/real-estate/compare.html (source src/demos/real-estate/pages/compare.json)