Updated
Package Tracker
NewCustomize
Start at stop0
Leg time3.2s
Color
Width860px
Installation
npx shadcn@latest add https://uibrik.com/r/package-tracker.jsonInstall the packages
npm install @tabler/icons-react motionAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/package-tracker/package-tracker.tsx"use client"; // A parcel on its way, in one wide card. On the left, a small isometric city: // blocks of buildings and parks, traffic on the streets, cloud shadows // drifting over, the route traced along the streets, numbered pins that drop // in as each stop is reached and a van driving from one to the next. At the // door the van hands the parcel over, the house lights up and the card turns // green; on autoplay the run starts over. Play, pause and replay sit on the // city. On the right: the delivery window, which narrows as stops go by, the // driver with call and message buttons, the parcel's details and the tracking // steps, each ticking off as the van arrives. Below about 700px it stacks. // // The city is one 2D canvas, painted back to front at device resolution. It // sleeps off screen and holds still for reduced motion. import { AnimatePresence, animate, motion, useMotionValue, useMotionValueEvent, useReducedMotion, type AnimationPlaybackControls, type MotionValue,
Adds the files to
components/uibrik/package-tracker and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/package-tracker.Too large to paste whole, so Copy prompt gives a short prompt that installs it with the CLI. Download the full prompt to attach it instead.
Usage
import { PackageTracker } from "@/components/uibrik/package-tracker/package-tracker";const stops = [ { title: "Picked up", place: "Oakland warehouse", time: "07:12", scans: [ { time: "06:48", text: "Label scanned, 1.4 kg" }, { time: "07:12", text: "Loaded onto trailer 22" }, ], }, { title: "At sort hub", place: "Hayward, CA", time: "09:40", scans: [ { time: "09:31", text: "Arrived at sort hub" }, { time: "09:40", text: "Sorted to route SM-14" }, ], }, // …3 more];const driver = { name: "Marcus Hale", rating: 4.9, vehicle: "Electric van", plate: "7KTR482", avatar: "/registry/package-tracker/driver.webp", phone: "+15550142",};const quickReplies = ["Leave it at the door", "I'm home", "Please ring the bell"];<PackageTracker live defaultStop={0} loop legSeconds={3.2} hour24={false} color="#8e4ec6" width={860} stops={stops} order="Order #4821" carrier="Swift Parcel" leftAt="Left at front door" driver={driver} parcel={{ weight: "1.4 kg", items: 2, signature: false }} quickReplies={quickReplies} onArrive={(index) => {}} // onCall={() => {}} // onMessage={(text) => {}} // reply={(text) => {}}/>Where to use Package Tracker
Store order pages
Window, route and scans in one card answer where is my order before anyone writes to support.
Pairs with Checkout Flow
Delivery and courier apps
The van moving between real stops makes the estimate feel live, and the scans back it up.
Email and notification landing pages
Link a shipping update straight to a card that shows the whole journey at a glance.
Props
PackageTracker- live
- Type boolean
- true
- Drive to the next stops on its own.
- defaultStop
- Type number
- 0
- Stop the van is at on mount.
- loop
- Type boolean
- true
- Start over from the first stop a few seconds after delivery.
- legSeconds
- Type number
- 3.2
- Seconds the van takes between two stops.
- hour24
- Type boolean
- false
- Show times in 24-hour format.
- color
- Type string
- "#8e4ec6"
- Colour of the route and the van. Turns green on delivery.
- width
- Type number
- 860
- Width of the card; never wider than its container.
- stops
- Type { title: string; place: string; time: string; scans?: { time: string; text: string }[] }[]
- –
- Two to five stops, first pickup to last delivery. Times are "HH:MM" in 24-hour time.
- order / carrier
- Type string
- –
- Header text.
- leftAt
- Type string
- "Left at front door"
- Shown once the parcel arrives.
- driver
- Type { name: string; rating?: number; vehicle?: string; plate?: string; avatar?: string; phone?: string }
- –
- Who is driving. phone makes the call button a tel: link; avatar is a photo URL, initials without one.
- parcel
- Type { weight?: string; items?: number; signature?: boolean }
- –
- Details shown as chips under the driver.
- onCall / onMessage
- Type () => void / (text: string) => void
- –
- Called when the call button is pressed and with each message sent from the card.
- reply
- Type (text: string) => string | null
- –
- The driver's reply to a message, shown after a typing indicator. Return null for none.
- quickReplies
- Type string[]
- –
- Quick replies offered before the first message.
- onArrive
- Type (index: number) => void
- –
- Called each time the van reaches a stop.
- className
- Type string
- –
- Classes for the wrapper.