Vehicle listing cards — Listings block
Freelistings-vehicle-listing-cards · for catalog, home, landing pages
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
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-vehicle-listing-cardsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ListingsVehicleListingCards from '@/components/trame/blocks/listings/listings-vehicle-listing-cards.vue'
const props = {
title: "Our current used cars",
intro: "Every vehicle is inspected in our shop before it goes on sale: service history and mileage verified.",
open: "vehicle.open",
vehicles: [
{
id: "v1",
title: "Restored vintage city car",
price: 1349000,
year: 1971,
mileage: 42300,
fuel: "Gas",
gearbox: "Manual",
power: "18 hp",
location: "Portland – Central Eastside branch",
image: "https://images.unsplash.com/photo-1757120602359-59272740fb0a?w=1600&q=80",
alt: "A small red car with a rounded roof parked in front of a light facade",
badges: [
"12-month warranty",
"One owner"
]
},
{
id: "v2",
title: "Electric compact 42 kWh",
price: 1890000,
monthly: 24900,
year: 2020,
mileage: 38900,
fuel: "Electric",
gearbox: "Automatic",
power: "170 hp",
location: "Beaverton branch",
image: "https://images.unsplash.com/photo-1656199133291-8bd65cc1369f?w=1600&q=80",
alt: "A gray compact parked along a tree-lined street",
badges: [
"Battery checked"
]
}
]
}
</script>
<template>
<ListingsVehicleListingCards v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title | string | Wordsa title for the stock ("Our current second-hand finds") |
| intro | string | Wordsone line under the title |
| vehicles* | Vehicle[] | Datathe vehicles of this page of the stock, in the order the dealer chose |
| open* | string | Actionthe page action a vehicle opens; it receives the vehicle |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Vehicle vehicles[] · 13 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe vehicle’s id in the tool that answers it |
| title* | string | Wordsmake, model and trim as the dealer writes it ("Compact 1.5 dCi Comfort") |
| price* | number | the asking price in cents |
| monthly | number | the monthly instalment in cents, only when the dealer offers financing |
| year* | number | the year of first registration |
| mileage* | number | kilometres on the clock |
| fuel* | string | Wordsthe energy, as the dealer writes it ("Diesel", "Hybrid", "Electric") |
| gearbox* | string | Words"Manual" or "Automatic" |
| power | string | Wordsthe power as written ("110 hp") |
| location | string | Wordsthe agency or town where the vehicle stands |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
| badges | string[] | Wordsa tag the dealer set ("12-month guarantee", "First hand") |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| location | boolean | show where each vehicle stands (default: yes) |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| money | formats a price, given in cents |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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:
open - Reads
vehiclesfrom your app
A listings section, for catalog, home, landing pages; it uses @lucide/vue.
More listings blocks
- Property detail brochure: one calm column in the manner of a printed brochure, sections set against a margin of labels, the contact at the end: a high-end property told slowly.
- Property detail gallery top: a mosaic of pictures first, then the facts and the ad, the contact beside them: a property whose photographs sell it.
- 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.
- 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.