Skip to content
Commerce block

Order Tracking Timeline

The fortnight between buying and reviewing, answered properly: an arrival range rather than a date, exceptions above the timeline, and a copyable carrier reference.

258 lineslucide-reactAdded 25 Aug 2026Updated 11 Sept 2026
  • order
  • tracking
  • shipping
  • timeline
  • delivery

What's included

  • components/order-tracking-timeline.tsx
  • Needs lucide-react

Works with

  • React
  • Next.js
  • Tailwind CSS
  • TypeScript

npx hoverlab add order-tracking-timeline

Or over MCP, from your editor's agent — no account needed.

License

Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.

Was this useful?

Start a page with this section — add more, order them, and leave with the page source.

Preview

Order NW-84213

Arriving Thursday 4 – Friday 5 September

EvriH00 4471 9928 3310
  1. Order placed

    Online · 29 Aug, 14:02

  2. Packed

    Peterborough fulfilment centre · 30 Aug, 08:41

  3. Collected by carrier

    Peterborough · 30 Aug, 17:15

  4. In transit

    Warrington hub · 31 Aug, 03:22

    Scanned at the sorting hub. The next scan is usually the local depot.

  5. Out for delivery — not yet

  6. Delivered — not yet

Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.

Source

components/order-tracking-timeline.tsx
/**
 * <OrderTrackingTimeline> — where the parcel is, and when it stopped being
 * useful to ask.
 *
 * Orders & Reviews had the confirmation, the history list and the reviews.
 * Between buying and reviewing there is a fortnight in which the only
 * question anyone has is this one, and answering it badly is what generates
 * the "where is my order" contact that dominates every support queue in
 * commerce.
 *
 * WHAT MAKES A TRACKING VIEW ANSWER THE QUESTION
 *
 *   An estimate with a shape, not a date. "Arriving Thursday" is a promise;
 *   "Thursday 4 – Friday 5 September" is information. Ranges are honest
 *   about what a carrier actually knows, and a range that slips by a day
 *   costs far less trust than a date that does.
 *
 *   The exception is louder than the progress. A delayed or failed delivery
 *   is the only state where somebody must act, so it gets its own line at
 *   the top rather than being a differently coloured dot two thirds down a
 *   list nobody reads to the end of.
 *
 *   The carrier's own reference, copyable. Half the people on this screen
 *   are about to go and paste it into the carrier's site, and a tracking
 *   number that has to be transcribed by eye is a support ticket in
 *   waiting.
 *
 * WHY THE TIMELINE IS AN ORDERED LIST
 *
 * It is a sequence of events in time, which is what `<ol>` means. A stack
 * of divs with a border-left is the same picture and none of the meaning:
 * a screen reader announces "list, 5 items" and then each step in order,
 * which is exactly the structure a sighted reader gets from the rail.
 *
 * The current step carries `aria-current="step"`. Without it the only thing
 * marking "you are here" is a filled circle, and a filled circle is not
 * information anybody can hear.
 *
 * Future steps are dimmed AND labelled. "Out for delivery — not yet" reads
 * correctly in a screen reader; a pale grey circle does not.
 *
 * Server component — no state, no effects.
 */

import type * as React from 'react'
import { AlertTriangle, Check, Copy, MapPin, Package, Truck } from 'lucide-react'

export type TrackingState = 'done' | 'current' | 'upcoming' | 'failed'

export interface TrackingStep {
  label: string
  /** Where it happened. Omitted for steps that have not happened. */
  place?: string
  /** When, already formatted. */
  at?: string
  state: TrackingState
  detail?: string
}

export interface OrderTrackingTimelineProps {
  orderRef?: string
  carrier?: string
  trackingNumber?: string
  /** A range, not a date. See the note above. */
  estimate?: string
  steps?: TrackingStep[]
  /** The one line that outranks the timeline when something is wrong. */
  exception?: { headline: string; body: string; actionLabel: string }
  className?: string
}

const DEFAULT_STEPS: TrackingStep[] = [
  {
    label: 'Order placed',
    place: 'Online',
    at: '29 Aug, 14:02',
    state: 'done',
  },
  {
    label: 'Packed',
    place: 'Peterborough fulfilment centre',
    at: '30 Aug, 08:41',
    state: 'done',
  },
  {
    label: 'Collected by carrier',
    place: 'Peterborough',
    at: '30 Aug, 17:15',
    state: 'done',
  },
  {
    label: 'In transit',
    place: 'Warrington hub',
    at: '31 Aug, 03:22',
    state: 'current',
    detail: 'Scanned at the sorting hub. The next scan is usually the local depot.',
  },
  { label: 'Out for delivery', state: 'upcoming' },
  { label: 'Delivered', state: 'upcoming' },
]

const ICONS: Record<TrackingState, React.ComponentType<{ className?: string }>> = {
  done: Check,
  current: Truck,
  upcoming: Package,
  failed: AlertTriangle,
}

/*
  Per-instance id, hashed from props that differ between instances.

  A literal id is a latent duplicate the moment this block is rendered
  twice on one document -- two pages on a catalog hub, or one page using
  the section twice. `aria-labelledby` pointing at a duplicated id resolves
  to whichever element comes first, so the second copy is announced with
  the first copy's label. Server component, so no `useId`: hashing props
  gives each instance its own target and stays stable across server and
  client renders in a way a counter would not.
*/
function instanceId(...parts: (string | undefined)[]): string {
  const text = parts.filter(Boolean).join('|')
  let hash = 0
  for (let i = 0; i < text.length; i++) hash = (Math.imul(hash, 31) + text.charCodeAt(i)) | 0
  return (hash >>> 0).toString(36).slice(0, 6)
}

export function OrderTrackingTimeline({
  orderRef = 'NW-84213',
  carrier = 'Evri',
  trackingNumber = 'H00 4471 9928 3310',
  estimate = 'Thursday 4 – Friday 5 September',
  steps = DEFAULT_STEPS,
  exception,
  className = '',
}: OrderTrackingTimelineProps) {
  const uid = instanceId(orderRef, trackingNumber)

  return (
    <section
      aria-labelledby={`tracking-heading-${uid}`}
      className={`mx-auto w-full max-w-2xl px-4 py-16 sm:px-6 lg:px-8 ${className}`}
    >
      <div className="overflow-hidden rounded-2xl border border-border bg-card">
        <header className="border-b border-border px-6 py-5">
          <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
            Order {orderRef}
          </p>
          <h2 id={`tracking-heading-${uid}`} className="mt-1 text-lg font-semibold text-foreground">
            Arriving {estimate}
          </h2>

          <div className="mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground">
            <span className="flex items-center gap-1.5">
              <MapPin aria-hidden className="h-4 w-4" />
              {carrier}
            </span>
            {/* Copyable, because the next thing they do is paste it. */}
            <span className="flex items-center gap-1.5">
              <span className="font-mono text-xs text-foreground">{trackingNumber}</span>
              <button
                type="button"
                className="rounded p-1 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
              >
                <Copy aria-hidden className="h-3.5 w-3.5" />
                <span className="sr-only">Copy tracking number {trackingNumber}</span>
              </button>
            </span>
          </div>
        </header>

        {/* Above the timeline, because it is the only state that needs
            somebody to do something. */}
        {exception ? (
          <div className="border-b border-border bg-destructive/5 px-6 py-4">
            <h3 className="flex items-center gap-2 text-sm font-semibold text-foreground">
              <AlertTriangle aria-hidden className="h-4 w-4 text-destructive" />
              {exception.headline}
            </h3>
            <p className="mt-1 text-sm text-muted-foreground">{exception.body}</p>
            <button
              type="button"
              className="mt-3 inline-flex h-8 items-center rounded-lg bg-primary px-3 text-sm font-semibold text-primary-foreground transition hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
            >
              {exception.actionLabel}
            </button>
          </div>
        ) : null}

        {/* An ordered list, because that is what this is. */}
        <ol className="px-6 py-5">
          {steps.map((step, i) => {
            const Icon = ICONS[step.state]
            const last = i === steps.length - 1
            const muted = step.state === 'upcoming'

            return (
              <li
                key={step.label}
                aria-current={step.state === 'current' ? 'step' : undefined}
                className="relative flex gap-4 pb-6 last:pb-0"
              >
                {/* The rail. Drawn per item and stopped on the last one, so
                    there is no trailing line under the final marker. */}
                {last ? null : (
                  <span
                    aria-hidden
                    className={`absolute start-[13px] top-7 h-[calc(100%-1.75rem)] w-px ${
                      step.state === 'done' ? 'bg-primary/40' : 'bg-border'
                    }`}
                  />
                )}

                <span
                  aria-hidden
                  className={`relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card ${
                    step.state === 'done'
                      ? 'bg-primary/15 text-primary'
                      : step.state === 'current'
                        ? 'bg-primary text-primary-foreground'
                        : step.state === 'failed'
                          ? 'bg-destructive/15 text-destructive'
                          : 'bg-muted text-muted-foreground'
                  }`}
                >
                  <Icon className="h-3.5 w-3.5" />
                </span>

                <div className="min-w-0 flex-1 pt-0.5">
                  <p
                    className={`text-sm font-medium ${muted ? 'text-muted-foreground' : 'text-foreground'}`}
                  >
                    {step.label}
                    {/* The state in words. A pale circle is not information
                        anybody can hear. */}
                    {muted ? (
                      <span className="font-normal text-muted-foreground"> — not yet</span>
                    ) : null}
                  </p>

                  {step.place || step.at ? (
                    <p className="mt-0.5 text-xs text-muted-foreground">
                      {[step.place, step.at].filter(Boolean).join(' · ')}
                    </p>
                  ) : null}

                  {step.detail ? (
                    <p className="mt-1.5 text-sm text-muted-foreground">{step.detail}</p>
                  ) : null}
                </div>
              </li>
            )
          })}
        </ol>
      </div>
    </section>
  )
}

Before you paste

  • Styling is Tailwind utility classes on semantic tokens (bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.
  • Install: npm i lucide-react
  • Every prop has a default, so it renders standalone before you wire it up.

Where it goes

Drop it at components/order-tracking-timeline.tsx and import it where you need the section:

import { OrderTrackingTimeline } from '@/components/order-tracking-timeline'

Customize

4 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.

Props

Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.

PropTypeDefault
orderRefstring'NW-84213'
carrierstring'Evri'
trackingNumberstring'H00 4471 9928 3310'
estimateA range, not a date. See the note above.string'Thursday 4 – Friday 5 September'
stepsTrackingStep[]DEFAULT_STEPS
exceptionThe one line that outranks the timeline when something is wrong.{ headline: string; body: string; actionLabel: string }—
classNamestring''

Not using React?

The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.

order-tracking-timeline.html
<!--
  Order Tracking Timeline — markup from the Hoverlab catalog.

  This is the block rendered once to HTML and wrapped as a component
  file. It is not a port of the React source: the Tailwind classes carry
  the design, which is the part that took the work, and they are the same
  in every framework.

  This block has no interactive behaviour, so nothing is missing.
-->
<section aria-labelledby="tracking-heading-1jg0eu" class="mx-auto w-full max-w-2xl px-4 py-16 sm:px-6 lg:px-8 ">
  <div class="overflow-hidden rounded-2xl border border-border bg-card">
    <header class="border-b border-border px-6 py-5">
      <p class="text-xs font-semibold uppercase tracking-wider text-muted-foreground">Order NW-84213</p>
      <h2 id="tracking-heading-1jg0eu" class="mt-1 text-lg font-semibold text-foreground">Arriving Thursday 4 – Friday 5 September</h2>
      <div class="mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground">
        <span class="flex items-center gap-1.5"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-map-pin h-4 w-4" aria-hidden="true"><path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"></path><circle cx="12" cy="10" r="3"></circle></svg>Evri</span>
        <span class="flex items-center gap-1.5">
          <span class="font-mono text-xs text-foreground">H00 4471 9928 3310</span>
          <button type="button" class="rounded p-1 transition hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-3.5 w-3.5" aria-hidden="true">
              <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
              <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
            </svg>
            <span class="sr-only">Copy tracking number H00 4471 9928 3310</span>
          </button>
        </span>
      </div>
    </header>
    <ol class="px-6 py-5">
      <li class="relative flex gap-4 pb-6 last:pb-0">
        <span aria-hidden="true" class="absolute start-[13px] top-7 h-[calc(100%-1.75rem)] w-px bg-primary/40"></span>
        <span aria-hidden="true" class="relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card bg-primary/15 text-primary">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check h-3.5 w-3.5" aria-hidden="true">
            <path d="M20 6 9 17l-5-5"></path>
          </svg>
        </span>
        <div class="min-w-0 flex-1 pt-0.5">
          <p class="text-sm font-medium text-foreground">Order placed</p>
          <p class="mt-0.5 text-xs text-muted-foreground">Online · 29 Aug, 14:02</p>
        </div>
      </li>
      <li class="relative flex gap-4 pb-6 last:pb-0">
        <span aria-hidden="true" class="absolute start-[13px] top-7 h-[calc(100%-1.75rem)] w-px bg-primary/40"></span>
        <span aria-hidden="true" class="relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card bg-primary/15 text-primary">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check h-3.5 w-3.5" aria-hidden="true">
            <path d="M20 6 9 17l-5-5"></path>
          </svg>
        </span>
        <div class="min-w-0 flex-1 pt-0.5">
          <p class="text-sm font-medium text-foreground">Packed</p>
          <p class="mt-0.5 text-xs text-muted-foreground">Peterborough fulfilment centre · 30 Aug, 08:41</p>
        </div>
      </li>
      <li class="relative flex gap-4 pb-6 last:pb-0">
        <span aria-hidden="true" class="absolute start-[13px] top-7 h-[calc(100%-1.75rem)] w-px bg-primary/40"></span>
        <span aria-hidden="true" class="relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card bg-primary/15 text-primary">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check h-3.5 w-3.5" aria-hidden="true">
            <path d="M20 6 9 17l-5-5"></path>
          </svg>
        </span>
        <div class="min-w-0 flex-1 pt-0.5">
          <p class="text-sm font-medium text-foreground">Collected by carrier</p>
          <p class="mt-0.5 text-xs text-muted-foreground">Peterborough · 30 Aug, 17:15</p>
        </div>
      </li>
      <li aria-current="step" class="relative flex gap-4 pb-6 last:pb-0">
        <span aria-hidden="true" class="absolute start-[13px] top-7 h-[calc(100%-1.75rem)] w-px bg-border"></span>
        <span aria-hidden="true" class="relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card bg-primary text-primary-foreground">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-truck h-3.5 w-3.5" aria-hidden="true">
            <path d="M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2"></path>
            <path d="M15 18H9"></path>
            <path d="M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14"></path>
            <circle cx="17" cy="18" r="2"></circle>
            <circle cx="7" cy="18" r="2"></circle>
          </svg>
        </span>
        <div class="min-w-0 flex-1 pt-0.5">
          <p class="text-sm font-medium text-foreground">In transit</p>
          <p class="mt-0.5 text-xs text-muted-foreground">Warrington hub · 31 Aug, 03:22</p>
          <p class="mt-1.5 text-sm text-muted-foreground">Scanned at the sorting hub. The next scan is usually the local depot.</p>
        </div>
      </li>
      <li class="relative flex gap-4 pb-6 last:pb-0">
        <span aria-hidden="true" class="absolute start-[13px] top-7 h-[calc(100%-1.75rem)] w-px bg-border"></span>
        <span aria-hidden="true" class="relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card bg-muted text-muted-foreground">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package h-3.5 w-3.5" aria-hidden="true">
            <path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path>
            <path d="M12 22V12"></path>
            <polyline points="3.29 7 12 12 20.71 7"></polyline>
            <path d="m7.5 4.27 9 5.15"></path>
          </svg>
        </span>
        <div class="min-w-0 flex-1 pt-0.5">
          <p class="text-sm font-medium text-muted-foreground">Out for delivery<span class="font-normal text-muted-foreground"> — not yet</span></p>
        </div>
      </li>
      <li class="relative flex gap-4 pb-6 last:pb-0">
        <span aria-hidden="true" class="relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full ring-4 ring-card bg-muted text-muted-foreground">
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package h-3.5 w-3.5" aria-hidden="true">
            <path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path>
            <path d="M12 22V12"></path>
            <polyline points="3.29 7 12 12 20.71 7"></polyline>
            <path d="m7.5 4.27 9 5.15"></path>
          </svg>
        </span>
        <div class="min-w-0 flex-1 pt-0.5">
          <p class="text-sm font-medium text-muted-foreground">Delivered<span class="font-normal text-muted-foreground"> — not yet</span></p>
        </div>
      </li>
    </ol>
  </div>
</section>
  • This is rendered HTML, not a translation of the React source. The Tailwind classes carry the design and work in any framework.
  • It is one frame: the component in its initial state, with no props applied beyond the defaults.
  • Requires Tailwind, and the design tokens the classes reference (bg-card, text-muted-foreground, and so on). The template ZIPs ship a globals.css that defines them.

What each framework gets across the whole catalog — effects convert properly; this rung is markup.

For AI

The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.

See the prompt

Used in these pages

Want the whole screen instead of this one section? Open a page and copy it entire.

6 more blocks in Orders & Reviews

All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.

Browse Orders & Reviews

Shipping one commercially

Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.

  • A commercial licence for everything in the catalog
  • Unlimited bundle exports, in Vue, Svelte and Tailwind
  • One payment — no subscription, nothing to renew
Pro — $79 once

More Orders & Reviews blocks

View category
Open the full page for this block

Order Confirmation

The thank-you screen built to prevent two support emails: a selectable order number and a delivery date range rather than "soon".

Orders & Reviews212 lines1 dep

Order History

Past orders with stacked item thumbnails and worded statuses — people recognise what they bought long before the order number.

Orders & Reviews195 lines1 dep
Open the full page for this block

Customer Reviews

Sortable reviews with verified-purchase badges, optimistic helpful votes and a real expand control instead of a fade that hides text.

Orders & Reviews274 lines1 dep
Open the full page for this block

Write a Review

The form that produces the reviews the other blocks display — a real radio group for stars, and a prompt that changes with the rating because one star and five need different questions.

Orders & Reviews249 lines1 dep
Open the full page for this block

Order Lookup Form

Order tracking for the guest who never made an account, which is most of them.

Orders & Reviews176 linesNo deps
Open the full page for this block

Review Distribution Band

The rating summary with the numbers that make an average trustworthy — the count, the spread and the verified share.

Orders & Reviews125 linesNo deps