Vehicle listing showcase — Listings block

Free

listings-vehicle-listing-showcase · for catalog, home, landing pages

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

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-showcase

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ListingsVehicleListingShowcase from '@/components/trame/blocks/listings/listings-vehicle-listing-showcase.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>
<ListingsVehicleListingShowcase v-bind="props" />
</template>

Props

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

PropTypeDescription
titlestringWordsa title for the stock ("Our current second-hand finds")
introstringWordsone line under the title
vehicles*Vehicle[]Datathe vehicles of this page of the stock, in the order the dealer chose
open*stringActionthe page action a vehicle opens; it receives the vehicle
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Vehicle vehicles[] · 13 props
PropTypeDescription
id*string | numberDatathe vehicle’s id in the tool that answers it
title*stringWordsmake, model and trim as the dealer writes it ("Compact 1.5 dCi Comfort")
price*numberthe asking price in cents
monthlynumberthe monthly instalment in cents, only when the dealer offers financing
year*numberthe year of first registration
mileage*numberkilometres on the clock
fuel*stringWordsthe energy, as the dealer writes it ("Diesel", "Hybrid", "Electric")
gearbox*stringWords"Manual" or "Automatic"
powerstringWordsthe power as written ("110 hp")
locationstringWordsthe agency or town where the vehicle stands
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
badgesstring[]Wordsa tag the dealer set ("12-month guarantee", "First hand")
Options options · 2 props
PropTypeDescription
locationbooleanshow where each vehicle stands (default: yes)
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
Linkyour router’s link component
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: open
  • Reads vehicles from your app

A listings section, for catalog, home, landing pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.

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.

All 9 listings blocks