Skip to content

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

Isochrone Reach Map Block for Solid

Travel-time bands on a live map: how far 10, 20 and 30 minutes go from three office sites on foot, by bike or by car, and how many of the team live inside.

On this page5 sections
UI library: Ark UI

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

Show how far people can get in a given time, with this isochrone reach map for Solid with Ark UI. Canalwise, an office search tool, helps a 60-person team in and round Amsterdam weigh three sites for its new office: by Centraal, at the Zuidas and at Sloterdijk. A Toggle Group over the live Map picks a way to travel (walk, bike or car) and the map shades how far the streets get you from the chosen site in 10, 20 and 30 minutes, each band one more layer of the same shade, so the nearer the darker; the map follows your theme, light or dark. The bands were worked out once along OpenStreetMap's streets by the public Valhalla routing service and typed into the file. The team's homes are dots, filled inside 30 minutes and hollow beyond, and the panel beside the map counts them in each band with a bar and a share, and lists the three sites with their 30-minute reach for the chosen way, so the sites compare at a glance. Pressing a band's row, or hovering its band on the map, outlines it. Built from Map, Toggle Group and Guides. For office moves, store and depot planning, delivery promises and any question of who is within reach.

FAQ

Where do the travel-time bands come from?

From Valhalla, an open routing engine, asked once while the block was written (valhalla1.openstreetmap.de's isochrone service) for each site and way: pedestrian, bicycle and auto costing, with 10, 20 and 30 minute contours. The thin slivers along the motorways, places you pass on them but can't get off at, were smoothed away, each band was kept inside the wider one, and the outlines were simplified to 30 to 54 points and typed into BAND_LINES; nothing is fetched while the block runs but the map's tiles. The car bands assume free-flowing roads with no live traffic, so treat them as a best case.

How are the homes counted?

Each home is tested against each band's outline with a point-in-polygon check (a ray cast to the east), once, when the block loads. The counts are cumulative: a home within 10 minutes is also within 20 and 30. The 60 homes are invented, scattered round the centres of real neighbourhoods and towns (the Jordaan, Amstelveen, Haarlem, Almere, Utrecht and more) by a seeded generator, so they are the same on every visit.

How do I read the map?

The three bands are shaded in one colour from the theme's chart ramp, each a light layer over the wider one, so the 10-minute band, under three layers, is the darkest; the legend's swatches match. Filled dots are homes within 30 minutes and hollow dots are further, so the reach is told by shape as well as by the numbers in the panel. The chosen site is the solid square; the others are hollow, and pressing one chooses it.

Can I use it without a mouse?

Yes. The way to travel is a toggle group, the sites and the bands in the panel are buttons (a band's button outlines it on the map), and the zoom buttons and the map itself work from the keyboard. Every count on the map is in the panel too, and a polite message reads the three counts once a choice settles.

How does it look on a phone?

The map comes first with the way-to-travel toggle over it, then the sites with their 30-minute reach, then the bands with their counts and bars, and the number further than 30 minutes. The camera frames the 30-minute band each time, so on foot it shows a few streets and by car most of the province.

How do I use my own places?

Ask an isochrone service (Valhalla, OpenRouteService or your own) for your sites once, simplify the rings and type them as site|way|minutes|lng,lat;… lines, or fetch them on demand in your app. Swap AREA_LINES for your team's or customers' places (rounded, never exact addresses); the counts and the panel follow.