Order lookup form and result — Storefront block

Pro

storefront-order-lookup-form-and-result · for account, order, tracking pages

Order lookup form and result

A guest types the order number and e-mail, the result appears below: orders placed without an account

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/storefront-order-lookup-form-and-result

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontOrderLookupFormAndResult from '@/components/trame/blocks/storefront/storefront-order-lookup-form-and-result.vue'

const props = {
order: {
id: "cmd-48213",
number: "RB-48213",
date: "October 12, 2026",
status: "shipped",
statusLabel: "Out for delivery",
lines: [
{
id: "l1",
product: {
id: "p1",
name: "Trail Path running shoe",
image: "https://images.unsplash.com/photo-1575987116913-e96e7d490b8a?w=1600&q=80",
alt: "A trail running shoe"
},
variant: "Midnight blue · 9",
unitPrice: 12900,
quantity: 1
},
{
id: "l2",
product: {
id: "p3",
name: "Insulated bottle 25 oz",
image: "https://images.unsplash.com/photo-1605714312496-01e90cb509cc?w=1600&q=80",
alt: "A white steel water bottle"
},
unitPrice: 3400,
quantity: 2
}
],
totals: {
subtotal: 19700,
shipping: 490,
total: 20190
},
window: "Today, between 10 a.m. and 1 p.m.",
tracking: {
carrier: "TrackPost",
number: "8L00123456789",
url: "https://trackpost.example/track",
events: [
{
date: "Oct 12, 9:14 a.m.",
label: "Order received by the workshop",
place: "Portland, OR",
done: true
},
{
date: "Oct 12, 4:40 p.m.",
label: "Package packed",
place: "Portland, OR",
done: true
}
]
}
},
title: "Track my order",
options: {
help: [
{
label: "Contact the carrier",
action: "carrier.contact"
},
{
label: "A problem with my order?",
action: "support"
}
],
accountLabel: "Sign in to see all my orders"
},
actions: {
lookup: "order.lookup",
account: "account.signIn"
}
}
</script>

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

Props

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

PropTypeDescription
orderOrderDatathe order and its shipment, from the carrier’s feed; absent before a guest looks one up
titlestringWordsthe heading ("Track my order")
noticestringWordsa delay or a change the carrier or the shop reports ("Delay due to the weather")
actions*Actionsthe page actions the block runs, each described below
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Order order · 15 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
number*stringWordsthe order’s number as the shop shows it
date*stringWordsthe date as the shop writes it
status*'pending' | 'paid' | 'preparing' | 'shipped' | 'delivered' | 'cancelled' | 'returned' | 'refunded'where the order stands
statusLabelstringWordsthe status in the shop’s words, instead of the block’s own
lines*(Line | Line)[]full cart lines, or summaries (name, quantity, total) when the tool keeps only those
totals*Totalsthe order’s amounts
shippingAddressShippingAddresswhere it is delivered
trackingTrackingthe carrier’s tracking, once shipped
windowstringWordsthe delivery window or date, as the carrier gave it: never guessed
stagesStage[]the order’s stages, in order, each done or not
parcelsParcel[]the parcels, when the order leaves in several
dayStepsDayStep[]the steps of the delivery day, for the day-of variant
stopsStopsthe driver’s route progress, only when the carrier provides it ("stop 7 of 24")
photoPhotothe photo proof, shown after delivery
Totals order.totals · 11 props
PropTypeDescription
subtotal*numberan amount in cents
discountnumberan amount in cents
discountLabelstringWordswhat the discount is, e.g. a code’s name
shippingnumber | nullnull: computed at the next step
shippingLabelstringWordsthe delivery method, e.g. "Standard delivery"
feesnumberfees the shop charges on top (service, handling), when it does
feesLabelstringWordswhat the fees are ("Service fee")
taxnumberan amount in cents
taxIncludedbooleantrue: the prices include tax
total*numberan amount in cents
currencystringDesignISO 4217, EUR by default
ShippingAddress order.shippingAddress · 7 props
PropTypeDescription
name*stringWordsthe recipient’s name
line1*stringWordsstreet and number
line2stringWordsa second address line: building, floor
postalCode*stringWordsthe postcode
city*stringWordsthe town
country*stringWordsthe country
phonestringWordsa phone number for the delivery
Tracking order.tracking · 4 props
PropTypeDescription
carrierstringWordswho carries it, e.g. "Colissimo"
numberstringWordsthe carrier’s tracking number
urlstringDesignthe carrier’s tracking page
eventsEvent[]the carrier’s tracking events
Event order.tracking.events[] · 4 props
PropTypeDescription
date*stringWordswhen it happened, as the carrier writes it
label*stringWordswhat happened, e.g. "Out for delivery"
placestringWordswhere it happened
done*booleantrue: this event has happened
Stage order.stages[] · 3 props
PropTypeDescription
label*stringWords"Order", "Prepared", "Shipped", "Delivered"
datestringWordswhen the stage was reached, as the shop writes it
done*booleantrue: the stage is reached
Parcel order.parcels[] · 10 props
PropTypeDescription
id*string | numberthe parcel’s id
labelstringWords"Parcel 1 of 2"
status*'pending' | 'paid' | 'preparing' | 'shipped' | 'delivered' | 'cancelled' | 'returned' | 'refunded'where the parcel stands
statusLabelstringWordsthe status in the shop’s words, instead of the block’s own
items*string[]Wordswhat is in the parcel ("2 × Insulated bottle")
carrierstringWordswho carries it, e.g. "Colissimo"
numberstringWordsthe carrier’s tracking number
urlstringDesignthe carrier’s tracking page
windowstringWordsthe delivery window, as the carrier gave it
eventsEvent[]the carrier’s tracking events
Event order.parcels[].events[] · 4 props
PropTypeDescription
date*stringWordswhen it happened, as the carrier writes it
label*stringWordswhat happened, e.g. "Out for delivery"
placestringWordswhere it happened, e.g. "Lyon hub"
done*booleantrue: this event has happened
DayStep order.daySteps[] · 3 props
PropTypeDescription
label*stringWordsthe step of the delivery day ("Loaded on the vehicle")
timestringWordswhen it happened, as the carrier wrote it ("08:15")
done*booleantrue: this step has happened
Stops order.stops · 2 props
PropTypeDescription
current*numberthe stops already made
total*numberthe stops on the route in all
Photo order.photo · 2 props
PropTypeDescription
src*stringPicturethe delivery photo the carrier took
altstringWordswhat the delivery photo shows
Actions actions · 2 props
PropTypeDescription
lookupstringActionwhere the guest lookup form posts
accountstringActiona named action of the page
Options options · 3 props
PropTypeDescription
helpHelp[]help links under the tracking, e.g. "Contact the carrier"
accountLabelstringWords"Sign in to see all my orders"
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
Help options.help[] · 2 props
PropTypeDescription
label*stringWords"Contact the carrier"
action*stringActiona named action of the page
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
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: actions.lookup, actions.account, options.help[]
  • Reads orders, shipments from your app

A storefront section, for account, order, tracking 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 storefront blocks

  • Order list cards: one card per order with its pictures and a progress line: a customer with a few orders to follow.
  • Order list reorder grid: the products already bought, to put back in the cart in one click: consumables and repeat purchases.
  • Order list rows: compact lines with the number, status, total and actions: a customer who orders often and scans the history.
  • Order list timeline: orders grouped in progress and finished, each with one honest line of status: a customer who wants to know what is on its way.
  • Order receipt narrow card: the confirmation, an email or an order page: a centred narrow card with the order number and the payment, no action.
  • Order review sections: the last look before paying: address, delivery, payment and items as editable rows, then totals and the pay button.
  • Order review with code card: the same, with a discount-code card above the totals that updates the amount on the pay button.
  • Order summary card: beside a form on a wide screen: a bordered card, sticky under the header, the lines then the rows then the total.

All 409 storefront blocks