Skip to content

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

Fire Stations Map Block for React

Five Pittsburgh fire stations with drive-time areas set by a 4 to 10 minute slider, fourteen past calls in time or late, and the road from each station.

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

See which calls an engine reaches in time, with this fire stations map for React with Base UI. Cinderwatch, a city fire service's planner, puts five numbered stations across Pittsburgh on a live Map that follows your theme, each with the area it reaches by road within the response target. A Slider sets the target from 4 to 10 minutes and the areas grow along the streets, stopping at the rivers and crossing at the bridges; darker shading is where two stations overlap. Fourteen past calls are diamonds, solid when the nearest station gets there in time and hollow when it's late, and the line over the map counts them ("10 of 14 calls reached in time, 71%"). The rail lists the calls by drive time with the same diamond and the words in time or late; choosing one, in the rail or on the map, draws the road from its nearest station, outlines that station's area, flies the map to the drive and fills the card over the map with the station, the minutes, the kilometres and the margin. Built from Map, Slider, Button and Guides. For fire and EMS planning, public safety dashboards and city operations teams.

FAQ

Where do the areas, times and roads come from, and what stays local?

They were worked out once, ahead of time, from OpenStreetMap routing at a car's pace, not an engine under lights: each call's time and road from every station, and each station's area for every target, sampled along 24 bearings. They're typed into the file as strings, so the block fetches nothing but the map's own tiles and dispatches nothing. Cinderwatch, the five stations and the fourteen calls are invented; the neighbourhoods and streets are real. Sample data, not advice.

How is a call counted as in time?

A call is in time when its drive from the nearest station takes no longer than the target. The areas on the map are drawn from the same routing and were checked against every call at every target, so a solid diamond always sits inside a shaded area and a hollow one outside. At 8 minutes ten of fourteen are in time; Brookline, nearly 12 minutes from Downtown, is late at every target.

Why are the areas such odd shapes?

Because an engine drives on roads. Each area follows the streets out from its station, stops at the Allegheny and the Monongahela where there's no bridge, and reaches further along fast roads. A notch is a park, a hillside or a river with no way across within the target. The outlined area is the chosen call's station.

What happens when I choose a call?

The rail row and the diamond mark it, the road from its nearest station is drawn in the theme's primary color, and MapCamera flies to frame the drive (or jumps there when reduced motion is on), never closer than a few streets around it. The card over the map says how much time is spare or how late it is at the current target. The map button beside zoom frames every call again.

Can I use it without a mouse?

Yes. The slider takes the arrow keys and reads its value in minutes, and every call in the rail is a button with a pressed state. The zoom buttons and the frame-all button work from the keyboard, and the map takes the arrow keys, plus and minus once focused. A polite message gives the count and the chosen call's margin once the choice settles.

How does it look on a phone?

The slider and the count come first, then the map with the call's card at its top, then the caption and the list of calls. The list keeps all fourteen rows at every target, so nothing jumps as you slide. Scrolling the page over the map scrolls the page; two fingers move the map.