Property detail sticky contact — Listings block

Free

listings-property-detail-sticky-contact · for product pages

Property detail sticky contact

One large picture with its strip, the price and the visit form that follow the visitor down the page: a visitor who reads long before asking

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/listings-property-detail-sticky-contact

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ListingsPropertyDetailStickyContact from '@/components/trame/blocks/listings/listings-property-detail-sticky-contact.vue'

const props = {
title: "Quiet 3-bedroom apartment with terrace",
kind: "Apartment",
address: "Portland, Nob Hill neighborhood",
reference: "Ref. 2041",
badge: "New",
price: 48500000,
fees: "Agent fees paid by the seller, included in the price.",
images: [
{
src: "https://images.unsplash.com/photo-1721932423849-e9033192b190?w=1600&q=80",
alt: "The bright living room, with its two large windows and gray sofa"
},
{
src: "https://images.unsplash.com/photo-1682888813913-e13f18692019?w=1600&q=80",
alt: "The open kitchen with its white marble island"
}
],
facts: [
{
icon: "surface",
label: "Area",
value: "990 sq ft"
},
{
icon: "rooms",
label: "Rooms",
value: "4"
}
],
description: [
"On the fourth floor of a small, well-kept condominium, this through-unit apartment was fully renovated in 2021. The 366 sq ft living room, open to the kitchen, steps straight out onto a south-facing terrace.",
"Three bedrooms, including a primary suite with its own shower room, sit in the quiet wing of the apartment. Built-in storage, solid hardwood floors and double glazing on every window."
],
features: [
{
title: "Interior",
items: [
"Solid hardwood floors",
"Fully equipped open kitchen"
]
},
{
title: "Outside",
items: [
"194 sq ft terrace",
"South-facing"
]
}
],
energy: {
consumption: "C",
consumptionValue: 132,
climate: "B",
climateValue: 14,
note: "Energy rating assessed in March 2025"
},
agent: {
name: "Camille Roux",
role: "Real estate agent",
company: "Nob Hill Realty",
phone: "(503) 555-0100",
email: "[email protected]",
hours: "Monday to Saturday, 9 a.m. to 7 p.m."
},
visit: {
action: "visit.request",
record: {
id: "b1"
},
slots: [
"Saturday 10 a.m.",
"Saturday 11:30 a.m."
],
submitLabel: "Request a viewing",
note: "The agency replies within 24 hours."
}
}
</script>

<template>
<ListingsPropertyDetailStickyContact v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe ad’s title, as the agency wrote it
kindstringWordswhat it is ("4-room flat")
addressstringWordswhere it is, as far as the agency shows it ("Lyon 6th, Brotteaux district"): never a street the owner did not agree to show
referencestringWordsthe agency’s reference ("Ref. 2041")
badgestringWordsa tag the agency set ("New", "Under offer")
price*numberthe asking price in cents, or the rent per month in cents
feesstringWordswhat the price includes or leaves out, as the law requires it shown ("Fees paid by the seller")
images*Image[]the property’s pictures, the first is the main one
facts*Fact[]the key facts, four to eight
description*string[]Wordsthe ad’s text, one string per paragraph
featuresFeature[]the property’s features in groups, e.g. "Interior", "Outdoor"
energyEnergythe energy diagnosis
agentAgentthe agent in charge, with how to reach them
visitVisitthe visit request form
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Image images[] · 2 props
PropTypeDescription
src*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordswhat the picture shows
Fact facts[] · 3 props
PropTypeDescription
icon*'surface' | 'rooms' | 'bedrooms' | 'bathrooms' | 'floor' | 'year' | 'parking' | 'garden'the pictogram of the fact
label*stringWordsthe fact’s name ("Area")
value*stringWordsits value as written ("78 m²")
Feature features[] · 2 props
PropTypeDescription
title*stringWordsthe group ("Interior", "Outdoor", "Amenities")
items*string[]Wordsone feature
Energy energy · 5 props
PropTypeDescription
consumption*'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G'the energy class of the diagnosis (DPE)
consumptionValuenumberkWh per m² and per year, as the diagnosis states it
climate'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G'the climate class (GES)
climateValuenumberkg of CO₂ per m² and per year, as the diagnosis states it
notestringWordsthe diagnosis’ date or reference, as written on it
Agent agent · 9 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
phonestringWordsa phone number
emailstringWordsan email address
hoursstringWordswhen the agent can be reached
Visit visit · 5 props
PropTypeDescription
action*stringActionthe page action that receives the visit request (a POST); it receives the property
recordRecord<string, unknown>Datathe property the request is about
slotsstring[]Wordsa visit slot the agency offers ("Saturday 10 am")
submitLabel*stringWordswhat the button says ("Request a viewing")
notestringWordswhat happens next, in a line ("The agency answers within 24 h.")
Options options · 2 props
PropTypeDescription
rentbooleanthe price is a rent per month
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
asseta picture’s address as your app serves it
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: visit
  • Reads properties from your app

A listings section, for product pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.

More listings blocks

  • Property listing cards: a grid of picture cards, price first: browsing a handful of properties by eye, a home page or a district page.
  • Property listing list: one dense row per property, facts on a line, the energy scale and the price on the right: comparing many properties.
  • Property map split: a compact list beside the host’s map slot: searching by place, when the map is part of the choice.
  • Vehicle listing cards: a grid of photo cards with a strip of key facts under each: browsing a dealer’s stock by eye, a home page or a make page.
  • Vehicle listing compare: one dense row per vehicle with year, mileage, fuel, gearbox and power in columns: comparing many vehicles on their numbers.
  • Vehicle listing showcase: wide rows with a large photo, the price and a full fact sheet, alternating sides: a few vehicles the dealer wants to push.

All 9 listings blocks