Place directory table — Locations block

Pro

locations-place-directory-table · for app, locations pages

Place directory table

Many places to compare: a table with a small pin tile, location, status and price or rating; a stacked list on a phone.

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/locations-place-directory-table

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import LocationsPlaceDirectoryTable from '@/components/trame/blocks/locations/locations-place-directory-table.vue'

const props = {
title: "Workshop spaces",
intro: "Find each place and its booking terms.",
places: [
{
id: "atelier",
name: "Canal Workshop",
location: "12 Willow Street",
description: "Workspace and order pickup.",
photo: {
src: "https://images.unsplash.com/photo-1445205170230-053b83016050?w=1600&q=80",
alt: "Bright interior of a retail space"
},
status: "By appointment",
price: 4500,
priceSuffix: "per half day",
rating: 4.6,
pin: {
number: 1,
x: 25,
y: 30
}
},
{
id: "cour",
name: "The Makers’ Courtyard",
location: "8 Weavers Lane",
status: "Booking open",
price: 6000,
priceSuffix: "per half day",
pin: {
number: 2,
x: 68,
y: 46
}
}
],
open: "place"
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
introstringWordsa sentence or two under the heading
places*Place[]Dataplaces with the merchant’s own positions, prices and ratings only
openstringActionopens the place in the host
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Place places[] · 11 props
PropTypeDescription
id*stringDatathe place’s id
name*stringWordsthe place’s name
location*stringWordsthe address or location line
descriptionstringWordsthe place’s description
photoPhotoa picture of the place
statusstringWordsthe host’s recorded availability or status
ratingnumberDatathe merchant’s own stored rating
pricenumberDatathe actual price in cents
currencystringDesignISO 4217 currency
priceSuffixstringWordsthe real unit or period, such as par jour
pinPinthe place’s pin on the map
Photo places[].photo · 2 props
PropTypeDescription
src*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordswhat the picture shows
Pin places[].pin · 3 props
PropTypeDescription
number*numberDatathe host’s numbered map reference
x*numberDatapercent from the image’s left edge
y*numberDatapercent from the image’s top edge
Options options · 3 props
PropTypeDescription
emptystringWordswhat an empty list says
footnotestringWordsa small line at the foot of the section
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
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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: open
  • Reads places from your app

A locations section, for app, locations pages; it uses @lucide/vue.

More locations blocks

  • Flagship store overlay: one main shop told large: its picture, with its address, hours and services on a card laid over it, the other places in a quiet row: a brand with one address that matters most.
  • Map list rail: A few places to browse: the host-provided map at full width, then a swipeable rail of numbered place cards under it.
  • Map list static split: Places beside a host-provided static map with numbered pins and attribution; positions, ratings and prices are the merchant’s own only.
  • Place cards tiles: a card per place with address, hours and services: one to six shops or offices.
  • Place finder split: a searchable numbered list, with the merchant’s map picture beside it: a dozen places or more.
  • Place services table: a table of places by service: when shops do not all offer the same things.
  • Pop up stops opening: one new place announced with its address and opening days: a shop that is about to open.
  • Pop up stops tour: dated stops with a status and a subscribe action: pop-ups and travelling events.

All 14 locations blocks