shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Tell people how close their parcel is in stops, not guesses, with this last mile delivery map for React with Base UI. Parcelfern, a courier app, follows one van's morning round through Barcelona's Eixample: twelve numbered stops on real streets, from Carrer de Villarroel to Carrer de València, joined by the road route the van drives, on a live Map that follows your theme. A card over the map (under it on a phone or tablet) holds the "My parcel" Native Select, the count of stops before yours, the minutes and a twenty-minute delivery window, worked out from each leg's typed drive time and four minutes at every door, and the whole round as a list with each stop's time. On the map, the road already driven is faint, the stretch from the courier to your stop is drawn in the primary colour with your stop's pin, and the rest of the round is dashed. The outline "Next stop (demo)" Button moves the courier on one stop, the clock and the counts follow, and the map flies to keep the courier and your door in view; once yours is delivered it says when. Built from Map, Native Select, Button and Guides. For courier and parcel apps, shop order pages and delivery notifications.
FAQ
How are the stops, minutes and window worked out?
Each stop has a typed drive time from the stop before it, and the courier spends DWELL (four) minutes at every door. arriveAt adds them up from the round's start at 09:30, so your stop's expected time is the sum up to it, and the minutes are that minus the time now. The window is ten minutes either side, rounded to five. The count is the stops between the courier and yours.
Is the route real?
Yes. Each leg is a road route from the OSRM demo service, asked once while the block was written and typed into LEGS; nothing is fetched while it runs. The drive times are OSRM's car times doubled for traffic and parking, typed into STOP_LINES. The streets are real; Parcelfern, the parcels and the times are sample data.
What does Next stop do?
It marks the next stop delivered and moves the van there: the clock jumps to when the courier leaves that door, the driven road grows, and the count, minutes and window update. Past the twelfth stop it offers to start the demo again. In your app, drive the same state from the courier's scans instead.
How does the map choose what to show?
The block keeps one aim: the courier and every stop up to yours, or the whole round once yours is delivered. MapCamera frames it, clear of the card on wider screens, and flies to each new one as the courier moves or you pick another parcel; your own pans stay until then.
Can I use it without a mouse?
Yes. The parcel is a native select and Next stop is a button, and the round is a numbered list that marks the next stop as current, so nothing depends on the map. A polite message gives the new count and time once a change settles. The map and its zoom buttons take the keyboard too.



