shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Show where one parcel is and where it goes next, with this package tracking map for React with Base UI. Boxmoth, a parcel carrier, follows shipment BX-48213 from Milan over the Alps to its Basel hub, up the Rhine to Cologne and on to a door in Amsterdam's De Pijp, each leg a real road route on a live Map that follows your theme. The rail at the start is the shipment's timeline: three scans done (picked up, cleared customs, sorted at the hub) and three expected (the Amsterdam hub, out for delivery, delivered), each with its place, its time and what happened or will, and a Badge for the shipment's state. On the map, the roads behind the parcel are solid and the roads ahead dashed, places it hasn't reached have dashed pins, and the parcel's own pin, in the primary colour, waits at the last scan. Choosing a step, in the timeline or on the map, rings its place; the Amsterdam steps fly in to the last mile, too small to see from Milan, and the route button shows the whole way again. Built from Map, Badge, Button and Guides. For parcel carriers, shops' order pages and logistics portals.
FAQ
How does it decide what is done?
LAST is the index of the last scan. Every scan before it, and the legs that lead to it, have happened; the scans after it are marked expected and their pins are dashed. The roads are split at the leg the last scan ends: solid behind, dashed ahead. Move LAST as new scans come in and everything follows.
Are the roads real?
Yes. Each leg is a road route from the OSRM demo service, asked once while the block was written, simplified and typed into LEGS; nothing is fetched while it runs. Milan, Basel, Cologne, Westpoort and De Pijp are real places; Boxmoth, the parcel and its times are sample data.
Why does the map zoom in for the Amsterdam steps?
From Milan to Amsterdam is over a thousand kilometres, so the Amsterdam hub and the door sit on top of each other at that scale. The block keeps one aim: the whole way for the first steps, the last mile for the Amsterdam ones, and MapCamera flies between them. Your own pans and zooms stay until you choose again.
Where do the times come from?
They are typed with each scan as fixed ISO times and shown in time elements, so the page never reads the clock. In your app, fill the scans from your carrier's tracking events and the expected ones from its estimate.
Can I use it without a mouse?
Yes. Each step in the timeline is a toggle button, and its place, time and note are written in the row, so nothing depends on the map. A polite message reads the chosen step once the choice settles. The pins are a pointer shortcut, and the map and its buttons take the keyboard too.




