Skip to content

shadcn.io is an independent project built on shadcn/ui

City Guide Walking Tours Map Block for React

Tabs for three Edinburgh walks, History, Food and Architecture, each a real footway route with five stops on a live map and its minutes added up.

On this page5 sections

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Choose a walk by its theme, with this city guide map for React with Base UI. Strollwick, a walking tour company, runs three walks through Edinburgh's Old and New Towns on a live Map that follows your theme. Tabs switch between History, Food and Architecture; each walk is five real stops, from the Castle Esplanade to Holyroodhouse or from Dean Village to the Scottish Parliament, joined by legs routed along OpenStreetMap's footways and drawn as one dashed line with numbered stops. Choosing a stop, on the map or in its cell, draws the leg that leads to it as a solid line and flies the camera to frame that leg; the frame button shows the whole walk again. Each cell gives the stop, a line about it, the minutes on foot from the stop before at 15 minutes a kilometre and the stay, and three cells add up the walking, the stops and the whole walk. Every walk has five stops and the cells reserve their lines, so changing tab never moves anything. Built from Map, Tabs, Button and Guides. For tour operators, tourist boards and museums.

FAQ

How are the walk's minutes worked out?

Each leg's length is the sum of its points' distances on a sphere, and MINUTES_PER_KM (15, a tour's pace with its pauses) turns it into minutes on foot. Each stop has a typed stay. The three cells add the legs, the stays and both, so changing a stop's place or its stay updates every figure.

Where do the routes come from?

Every leg was routed once on foot along OpenStreetMap's footways and baked into SPECS, simplified to a few dozen points; nothing is fetched at runtime except the map's tiles. Each stop sits where its leg ends, so the stops and the line can't drift apart. The places are real; Strollwick, the stays and the order of the stops are invented sample data, and nothing is booked.

What happens when I choose a stop?

The leg from the stop before is drawn solid over the dashed walk and the camera flies to frame it, quickly or not at all when reduced motion is on, so you see the way there from door to door. The first stop has no leg, so the camera takes a close look at it instead. The frame button, or a new tab, brings the whole walk back into view.

Can I use it without a mouse?

Yes. The walks are tabs (arrow keys move between them), every stop is a button in its panel, and the zoom and frame buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. The numbered markers are a pointer shortcut to the same choice, and a polite message gives the walk's totals or the chosen stop once the choice settles.

How does it look on a phone?

The tabs come first, then the map with the stop numbers (a stop's name shows once you choose it), then the five stops as rows and the three totals. Every row keeps two lines for its note, so switching walks never changes the page's height.