Shipment detail map band — Record block

Pro

record-shipment-detail-map-band · for app pages

Shipment detail map band

The map as a wide band under the header with the route and facts in a card over it, the feed in full width below: a team that reads where the shipment is first; positions and times from the carrier only

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/record-shipment-detail-map-band

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import RecordShipmentDetailMapBand from '@/components/trame/blocks/record/record-shipment-detail-map-band.vue'

const props = {
title: "Shipment EXP-20418",
subtitle: "Express courier · 2 parcels",
back: {
label: "Shipments",
action: "shipments"
},
status: {
label: "In transit",
tone: "info"
},
order: {
label: "Order #1048",
action: "order",
record: {
id: 1048
}
},
actions: {
primary: {
label: "Notify the customer",
action: "notify-customer"
},
secondary: [
{
label: "Print labels",
action: "print-labels"
},
{
label: "Report a problem",
action: "report-issue"
}
]
},
route: [
{
place: "Workshop warehouse, Portland, OR",
detail: "Left October 14 at 5:40 PM",
state: "done"
},
{
place: "Regional facility, Salem, OR",
detail: "Scanned October 14 at 9:05 PM",
state: "done"
}
],
stages: [
"Packed",
"Handed to carrier"
],
stage: 2,
facts: [
{
label: "Carrier",
value: "Express courier, 24-hour service"
},
{
label: "Tracking number",
value: "6A 204 118 377 US"
}
],
activity: {
title: "Carrier tracking",
items: [
{
time: "Oct 15 · 4:12 AM",
place: "Sacramento",
text: "Arrived at the sorting hub"
},
{
time: "Oct 15 · 12:30 AM",
place: "Salem",
text: "Left the regional facility"
}
]
},
map: {
src: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221200%22%20height%3D%22760%22%20viewBox%3D%220%200%201200%20760%22%3E%3Ctitle%3EFictional%20route%20schematic%3C%2Ftitle%3E%0A%3Cg%20fill%3D%22none%22%20stroke%3D%22%238b919a%22%20stroke-opacity%3D%22.28%22%20stroke-width%3D%2210%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M-20%20140C200%20170%20330%20120%20470%20120S760%20210%20900%20180%201120%2090%201220%20120%22%2F%3E%3Cpath%20d%3D%22M80%20760C160%20600%20260%20520%20420%20470S700%20380%20820%20260%20980%2060%201040%20-20%22%2F%3E%3Cpath%20d%3D%22M-20%20520C180%20500%20360%20560%20560%20600S900%20640%201220%20600%22%2F%3E%3C%2Fg%3E%0A%3Cg%20fill%3D%22none%22%20stroke%3D%22%238b919a%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%223%22%3E%3Cpath%20d%3D%22M0%20330H1200M0%20430C300%20400%20500%20450%201200%20410M300%200V760M760%200C740%20260%20780%20480%20760%20760%22%2F%3E%3C%2Fg%3E%0A%3Cpath%20fill%3D%22%238b919a%22%20fill-opacity%3D%22.1%22%20d%3D%22M930%20470c60-30%20160-20%20210%2030s30%20140-40%20170-180%2010-210-50%200-120%2040-150z%22%2F%3E%0A%3Cpath%20fill%3D%22none%22%20stroke%3D%22%234f6bd8%22%20stroke-width%3D%227%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M612%20640L660%20590%20690%20470%20668%20330%22%2F%3E%0A%3Cpath%20fill%3D%22none%22%20stroke%3D%22%234f6bd8%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%227%22%20stroke-linecap%3D%22round%22%20stroke-dasharray%3D%222%2018%22%20d%3D%22M668%20330L600%20210%20470%20110%22%2F%3E%0A%3Cg%20fill%3D%22%234f6bd8%22%3E%3Ccircle%20cx%3D%22612%22%20cy%3D%22640%22%20r%3D%2212%22%2F%3E%3Ccircle%20cx%3D%22660%22%20cy%3D%22590%22%20r%3D%2210%22%2F%3E%3Ccircle%20cx%3D%22470%22%20cy%3D%22110%22%20r%3D%2212%22%20fill-opacity%3D%22.55%22%2F%3E%3C%2Fg%3E%0A%3Ccircle%20cx%3D%22668%22%20cy%3D%22330%22%20r%3D%2230%22%20fill%3D%22%234f6bd8%22%20fill-opacity%3D%22.18%22%2F%3E%3Ccircle%20cx%3D%22668%22%20cy%3D%22330%22%20r%3D%2215%22%20fill%3D%22%234f6bd8%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%225%22%2F%3E%0A%3C%2Fsvg%3E",
alt: "Schematic of the route, from the departure at the bottom to the destination at the top, with the current position marked at the sorting hub.",
attribution: "Demo illustration, not geographically accurate"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe shipment’s name ("Shipment EXP-20418")
subtitlestringWordsone line under the title: the carrier service, the parcels, the weight
backBackthe back action: its words and the page action it runs
statusStatusthe shipment’s status, in words and colour
orderOrderthe order action: its words and the page action it runs
actionsActionswhat can be done on the shipment
route*Route[]the route from the origin to the destination, through its hubs
stages*string[]Words"Prepared", "Handed to the carrier", "In transit", "Out for delivery", "Delivered"
stage*numberDatathe index of the stage reached, from the carrier feed
factsFact[]the facts shown, in order
activityActivitythe carrier’s events, newest first
mapMapa static map the host provides
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Back back · 2 props
PropTypeDescription
label*stringWords"Shipments"
action*stringActionthe list
Status status · 2 props
PropTypeDescription
label*stringWordsthe status as the app says it ("In transit")
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'the status colour
Order order · 3 props
PropTypeDescription
label*stringWordsthe linked order ("Order #1048")
action*stringActionopens the order
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
Actions actions · 2 props
PropTypeDescription
primaryPrimarythe main button: its words and the page action it runs
secondarySecondary[]other actions on the shipment
Primary actions.primary · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
Secondary actions.secondary[] · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
Route route[] · 3 props
PropTypeDescription
place*stringWordsthe town or hub, as the carrier names it
detailstringWordswhen it passed or is due, as the carrier wrote it; nothing when the carrier gives nothing
state*'done' | 'current' | 'next'passed, where the parcel is now, still ahead
Fact facts[] · 2 props
PropTypeDescription
label*stringWords"Carrier", "Last scan", "Delivery slot"
value*stringWordsas the carrier gives it
Activity activity · 3 props
PropTypeDescription
title*stringWords"Carrier tracking"
items*Item[]the history’s entries
emptystringWordswhat an empty feed says
Item activity.items[] · 3 props
PropTypeDescription
time*stringWordsas the carrier wrote it
placestringWordswhere it happened
text*stringWordswhat happened
Map map · 3 props
PropTypeDescription
src*stringPicturea static map picture the host renders, never a map service’s tiles
alt*stringWordswhat the picture shows: the area and the route
attributionstringWordsthe attribution the host must show, verbatim
Options options · 1 props
PropTypeDescription
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
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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: back, order, actions.primary, actions.secondary[]
  • Reads shipments from your app

A record section, for app 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 record blocks

  • Detail page: a record read top to bottom: header with its status and actions, fields in sections, linked lists beneath.
  • Detail split: a record read mostly for its linked lists: its fields in a narrow column beside them.
  • Facets tabbed: a record with many facets (overview, items, documents, history): one panel at a time, the tab kept in the address.
  • Invoice compact: A narrow receipt-like document with stacked line items for the merchant’s own short invoices.
  • Invoice document: A complete document with seller, buyer and a tax ledger, using the merchant’s own invoice only.
  • Invoice split: The merchant’s own invoice with a separate payment summary and actions for collection workflows.
  • Profile sidebar: a person or an organisation: a side rail with identity, stored counters and key facts, the work in the main column.
  • Support ticket workspace: A support case desk with the merchant’s own conversation, internal notes, reply macros and customer orders aside.

All 11 record blocks