Product stockists split — Locations block
Prolocations-product-stockists-split · for stores, contact, about pages
Product stockists split
A product sold through partners: the online retailers on one side, the stores that carry it — with the stock they report — on the other.
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-product-stockists-splitUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import LocationsProductStockistsSplit from '@/components/trame/blocks/locations/locations-product-stockists-split.vue'
const props = {
title: "Where to buy the Trail Path backpack",
lead: "Online from our partners, or in a store near you.",
places: [
{
id: 1,
name: "Downtown Shop",
address: "12 Weavers Street\nPortland, OR 97204",
phone: "(503) 555-0101",
hours: [
{
days: "Tuesday – Friday",
hours: "10 a.m. – 7 p.m."
},
{
days: "Saturday",
hours: "10 a.m. – 6 p.m."
}
],
services: [
{
name: "Order pickup"
},
{
name: "Repairs",
note: "on Saturdays"
}
],
note: "Orders ready for pickup in two hours.",
status: "Open",
country: "United States",
region: "france"
},
{
id: 2,
name: "Pearl District Workshop",
address: "4 Grand Hill Road\nPortland, OR 97209",
phone: "(503) 555-0102",
hours: [
{
days: "Wednesday – Saturday",
hours: "2 – 6 p.m."
}
],
services: [
{
name: "Repairs"
},
{
name: "Workshop tour",
note: "by appointment"
}
],
status: "Open",
country: "United States",
region: "france"
}
],
product: {
id: "sac-sentier",
name: "Trail Path backpack",
image: "https://images.unsplash.com/photo-1473188588951-666fce8e7c68?w=1600&q=80",
alt: "A patinated brown leather satchel resting on a stone"
},
retailers: [
{
name: "The Fine Canvas",
url: "https://example.com/la-belle-toile",
note: "Online and in store"
},
{
name: "Central Notions",
url: "https://example.com/mercerie-centrale",
note: "Online"
}
],
stores: [
{
id: 101,
name: "Graine — San Francisco",
address: "28 Sevigne Street\nSan Francisco, CA 94110",
hours: [
{
days: "Monday – Saturday",
hours: "11 a.m. – 7 p.m."
}
],
stock: "6 in stock"
},
{
id: 102,
name: "The Green Stall — Sacramento",
address: "9 Crebillon Street\nSacramento, CA 95814",
hours: [
{
days: "Tuesday – Saturday",
hours: "10:30 a.m. – 7 p.m."
}
],
stock: "2 in stock"
}
],
map: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=1600&q=80",
options: {
mapAlt: "Map of the United States showing partner stores"
}
}
</script>
<template>
<LocationsProductStockistsSplit v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the page shows ("Our shops") |
| lead | string | Wordsone sentence on the places |
| places* | Place[] | Datathe real places, with real addresses |
| product | Product | Datathe product the partners carry, for the where-to-buy variant |
| retailers | Retailer[] | the online retailers that sell the brand |
| stores | Store[] | Datathe partner stores that carry the product, with the stock each reports |
| services | string[] | Wordsa service, as a column of the matrix |
| map | string | Picturea picture of a map the merchant provides: there is no map library |
| image | string | Picturea picture of the flagship place, for the flagship variant |
| cta | Cta | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Place places[] · 12 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | the place’s id |
| name* | string | Wordsthe place’s name ("Lyon city-centre shop") |
| address* | string | Wordsthe full postal address, lines separated by a new line |
| phone | string | Wordsits telephone number |
| string | Wordsits e-mail address | |
| hours | Hour[] | its real opening hours |
| services | Service[] | the services offered here |
| status | string | Wordswhere it stands, as the merchant says it ("Open", "Waiting list") |
| date | string | Wordswhen, for a pop-up or an opening, as the merchant writes it ("12 – 14 November") |
| note | string | Wordsa line on the place ("Orders ready for pickup in 2 hours") |
| country | string | Wordsthe country, for the stockist index ("France") |
| region | string | Designthe region of the stockist index it belongs to, from the `regions` list |
Hour places[].hours[] · 2 props
| Prop | Type | Description |
|---|---|---|
| days* | string | Wordsthe days ("Tuesday – Friday") |
| hours* | string | Wordsthe hours ("10 am – 7 pm") |
Service places[].services[] · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsa service offered here, spelled as in the `services` list |
| note | string | Wordsa precision ("on Saturdays") |
Product product · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
Retailer retailers[] · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe retailer’s name ("The Fine Cloth") |
| url* | string | Designthe retailer’s own address, outside the app |
| note | string | Wordsa precision ("online and in store") |
Store stores[] · 14 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | the place’s id |
| name* | string | Wordsthe place’s name ("Lyon city-centre shop") |
| address* | string | Wordsthe full postal address, lines separated by a new line |
| phone | string | Wordsits telephone number |
| string | Wordsits e-mail address | |
| hours | Hour[] | its real opening hours |
| services | Service[] | the services offered here |
| status | string | Wordswhere it stands, as the merchant says it ("Open", "Waiting list") |
| date | string | Wordswhen, for a pop-up or an opening, as the merchant writes it ("12 – 14 November") |
| note | string | Wordsa line on the place ("Orders ready for pickup in 2 hours") |
| country | string | Wordsthe country, for the stockist index ("France") |
| region | string | Designthe region of the stockist index it belongs to, from the `regions` list |
| stock | string | Wordsthe stock as the store reports it ("4 in stock"), from its live data; omitted when unknown |
| distance | string | Wordshow far it is ("1.2 km") |
Hour stores[].hours[] · 2 props
| Prop | Type | Description |
|---|---|---|
| days* | string | Wordsthe days ("Tuesday – Friday") |
| hours* | string | Wordsthe hours ("10 am – 7 pm") |
Service stores[].services[] · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsa service offered here, spelled as in the `services` list |
| note | string | Wordsa precision ("on Saturdays") |
Cta cta · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Be told of the next date") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| mapAlt | string | Wordswhat the map picture shows |
| 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 |
| 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:
cta - Reads
locations,productsfrom your app
A locations section, for stores, contact, about pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More locations blocks
- Place cards tiles: a card per place with address, hours and services: one to six shops or offices.
- Place directory list: Places with location lines and optional photos; positions, ratings and prices are the merchant’s own only.
- 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.
- 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.
- Stockist directory grouped: a wide network of stockists, grouped by region and country as light text rows: twenty addresses and more.