shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Tell a journey as the reader scrolls, with this story scroll map for React with Ark UI. Fellstride, a walking holidays company, tells Hadrian's Wall Path in seven chapters, from Segedunum on the Tyne to Bowness-on-Solway, beside a live Map that follows your theme, light or dark, and stays pinned while the chapters scroll. Each chapter that reaches the middle of the story's box aims the camera at its day: the day's walk is drawn in the primary colour, the days before it solid and the days after dashed, and its places light up with their names (Roman forts are squares, villages and sights dots). Every chapter gives the day's kilometres and hours on foot, worked out from the line on the map, and lists its places. A band of chapters above the story jumps to any of them and marks the one showing; the frame button goes back to the whole walk. On a phone the map pins to the top of the box and the chapters slide under it. Built from Map, Button and Guides. For travel writing, walking and cycling holidays, guided tours and any long-read told through places.
FAQ
How does scrolling move the map?
An IntersectionObserver watches the chapters inside the story's own scrolling box, with a thin line at its middle (rootMargin of minus half the box above and below). The chapter crossing that line is the one showing: MapCamera gets its day's corners and flies there, quickly or not at all when reduced motion is on. A jump from the band ignores the chapters it scrolls past, so the camera doesn't stop at each.
Where does the walk come from, and what stays local?
The twelve places sit at their real coordinates, and each day's line was routed once along OpenStreetMap's footpaths (routing.openstreetmap.de, foot profile), simplified to 70 points and typed into LEGS. The kilometres are measured along those lines on the sphere and the hours are at Fellstride's invented pace of 3.5 km an hour, so they are close to, not the same as, the National Trail's own figures. Nothing is fetched or saved but the map's tiles.
What does the map show for each chapter?
The opening chapter frames the whole walk and lights its two ends. Each day's chapter frames that day, draws it in the primary colour over the days already walked (solid) and the days to come (dashed), and lights its places with their names; the other places stay as small hollow marks with their name on hover. The places a chapter lights are also listed in the chapter, so nothing is on the map alone.
Can I use it without a mouse?
Yes. The chapter band is a row of buttons, the one showing marked as the current step; pressing one scrolls its chapter into place. The story's box takes focus, so the arrow keys, Page Up and Page Down and Space scroll it, and the zoom buttons and the map itself (arrows, plus and minus) work from the keyboard. A polite message names the day and its distance once the scrolling settles.





