shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Let drivers weigh their options, with this route alternatives map for Vue with Ark UI. Forkway, a road-trip planner, draws three ways from Lisbon to Porto on a live Map that follows your theme, light or dark: the fastest along the A1, the coast road on the A8 and A17, and a toll-free run inland on the IC2. Each route carries a bubble with its driving time where it runs furthest from the others, as navigation apps do. Choose a route, by its line, its bubble or its row, and it's drawn on top in the accent colour while the other two fade to grey; the camera holds still, so nothing jumps. The rows compare the three at a glance (time, a Fastest or No tolls tag, distance, tolls, and how much longer than the fastest), and the card under them gives the chosen route's arrival for a 09:00 start, its kilometres on toll roads, the toll price and the roads it mostly takes, each with a bar of its share. Built from Map and Guides. For trip planners, logistics quotes, travel guides and any choice between ways to get somewhere.
FAQ
How do I choose a route?
Press its line on the map (each MapRoute is interactive, with onRouteClick), its time bubble, or its row in the list. The chosen route gets active: it's raised over the others and drawn wider in the accent colour, while the others stay as thinner grey lines you can still press.
Where do the routes, times and tolls come from?
They were asked once, at authoring time, of OpenStreetMap routing (Valhalla): the fastest route with two alternatives, and the fastest route that avoids tolls. Each route's shape was simplified to about a hundred points and typed into the file with its length, its time without traffic and its kilometres on toll roads. The toll price is an invented flat rate a tolled kilometre; Forkway is invented. Nothing is fetched or saved but the map tiles.
Where do the time bubbles go?
Each bubble sits at a share of its route (MapRouteMarker at) picked where that route runs furthest from the other two, so the three never pile up. The chosen route's bubble turns solid and sits above the others.
Can I use it without a mouse?
Yes. The three rows are buttons with a pressed state, and each reads the route's time, roads, distance, tolls and extra time. The map takes the arrow keys and plus and minus once focused, and the zoom buttons work from the keyboard; the lines and bubbles are a pointer shortcut to the same choice. A polite message gives the chosen route's time, distance, tolls and arrival.





