Order tracking
Where an order is and how it got there: a horizontal route that fills up to the current step (a pinging marker while it travels), a tone-stitched event log beneath, and the live status on a badge — refreshes itself under wire:poll.
Real scenarios
The component as it is used in a product — not a specimen grid.
A parcel on the Bursa → Istanbul road
The fill draws itself up to the current step (a pinging marker while it travels), the badge breathes while the order runs and the event log slides in row by row. current rides a Livewire property here, so the button walks the whole route — and on a real page wire:poll.30s does it without anyone clicking.
Order no.: ۱۴۰۴-۰۸۲۱۵
- Carrier
- SwiftPost
- Expected delivery
- In 2 days
-
Order placed
-
Paid
-
Packed
-
In transit
Bursa → Istanbul
-
With the courier
-
Delivered
Events
-
Order placed and sent to the warehouse
-
Payment confirmed
Bank gateway
-
Packing ran 40 minutes late
-
Left the distribution centre
Dates can be real dates (they read as relative time in the app’s language) or plain labels; the step numbers are formatted in the app’s digits.
A delivery that failed
No current here at all — every step carries its own state, so the route can fork away from a straight line (the parcel may yet go back to the warehouse). The failed badge stops breathing with :live="false" and the log stitches danger, info and warning rows by tone.
Order no.: 981,120
- Carrier
- SpeedEx
- Expected delivery
- Second attempt: tomorrow ۱۰–۱۴
-
Order placed
-
In transit
-
With the courier
-
Delivered
-
Back to the warehouse
Events
-
Delivery failed — recipient unreachable
-
SMS sent to the recipient
Second attempt tomorrow
-
Held at the courier hub
Returns to the warehouse after 3 days
An order that just landed
The bare minimum: three steps, current at the first, no events yet — the block says so itself instead of an empty box. In a shop this is the screen right after checkout.
Order no.: ۴۵۲۱
-
Order placed
-
Packing
-
Delivered
Events
- No events yet
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| steps | array | [] | Step keys: id, title, description, icon, time (a date → relative time, or a plain label) and state (complete | current | upcoming), which wins over current. |
| current | string | int | null | The current step’s id or index; the steps before it read as complete, the ones after as upcoming. |
| events | array | [] | Keys: id, title, description, place, tone (success | warning | info | danger), icon, time; empty and the block says so itself. |
| status / statusLabel / live | string / string / bool | null / null / true | The status on the badge: running | success | failed | queued | canceled; a custom label and whether its dot breathes. |
| number / carrier / eta | string | null | The order number (numeric ones get locale digits), the carrier and the expected delivery in the header. |
| label / labels / locale | string / array / string | null / [] / null | The card’s accessible name, overrides for the block’s own words, and the locale for digits and dates. |
| wire:poll و x-on:* | attribute | — | Any wire/event attribute lands on the root — wire:poll.30s="checkOrder" morphs the whole block into its fresh server state. |
Snippet
<x-nx::order-tracking number="۱۴۰۴-۰۸۲۱۵" status="running" carrier="تندپست" eta="۲ روز دیگر"
:steps="[
['id' => 'placed', 'title' => 'ثبت سفارش', 'icon' => 'file', 'time' => now()->subDays(2)],
['id' => 'transit', 'title' => 'در مسیر', 'icon' => 'zap'],
['id' => 'done', 'title' => 'تحویل شد', 'icon' => 'home'],
]"
current="transit"
:events="[['title' => 'بسته از مرکز توزیع خارج شد', 'place' => 'بورسا', 'time' => now()->subHours(2), 'tone' => 'success']]" />