Order Tracker
NewA delivery or job status card. The progress line fills step by step, the current step pulses, the ETA counts down live, and the courier and item list sit underneath. Works for shipping and repair shop jobs alike.
motionlucide-reactutilsavatarbuttonbutton-groupcarditemseparator@soultel/rolling-number@soultel/use-reduced-motion-safe
Installation
$ pnpm dlx shadcn@latest add @soultel/order-trackerNo namespace set up? npx shadcn@latest add https://asafefe.dev/r/order-tracker.json works too.
Manual installation
- 1. Install the dependencies.
terminal1 lines npm install motion lucide-react - 2. Copy the source from the Code tab into components/order-tracker.tsx.
Usage
import { OrderTracker } from "@/components/order-tracker"
export function RepairStatus({ job }: { job: Job }) {
return (
<OrderTracker
title={`Repair job ${job.number}`}
subtitle="MacBook Pro 14, battery and keyboard"
etaLabel="Ready in"
doneLabel="Ready for pickup"
eta={job.readyAt}
currentStep={job.stage}
steps={[
{ id: "in", label: "Checked in", time: "Mon 10:02 AM" },
{ id: "diag", label: "Diagnosis", description: "A technician is testing the battery and keyboard." },
{ id: "parts", label: "Parts ordered" },
{ id: "repair", label: "Repair" },
{ id: "qa", label: "Quality check" },
]}
courier={{ name: job.technician, vehicle: "Technician", rating: 4.9 }}
onContact={(method) => (method === "call" ? callShop() : openChat())}
/>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | - | e.g. "Order #4821" or "Repair job 1093". |
| subtitle | string | - | Line under the title. |
| steps | OrderStep[] | - | { id, label, description, time }[]. The description shows while the step is current. |
| currentStep | number | 0 | Index of the step in progress. Earlier steps show as done, steps.length marks everything done. |
| eta | Date | string | number | - | Expected arrival. Drives the live countdown and the Expected time. |
| etaLabel | string | "Arriving in" | Label over the countdown, e.g. "Ready in". |
| doneLabel | string | "Delivered" | Shown once every step is done. |
| courier | OrderCourier | - | name, and optional avatar (photo URL), vehicle and rating. |
| onContact | (method: "call" | "message") => void | - | Adds call and message buttons by the courier. |
| items | OrderItem[] | - | { id, name, quantity, and optional variant, price, image, imageAlt }[], shown in an expandable list. |
| total | number | - | Overrides the sum of item prices. |
| defaultItemsOpen | boolean | false | Start with the item list open. |
| currency | string | "$" | Symbol shown before prices. |
| locale | string | "en-US" | Used for the Expected time. |
