Skip to content

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

Utility Outages Map Block for React

Ten Brisbane zones on a live map shaded by customers still without power, a clock that restores them by forecast, and a steps timeline for each zone.

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

Show when the power comes back after a storm, zone by zone, with this utility outages map for React with Base UI. Gridkeep, an electricity network operator, draws ten suburbs of Brisbane's inner west as zones on a live Map with their real borders, each shaded in four steps of the theme's chart colours by the customers still without power and carrying a pill with the count, or a check once it's back on. A Toggle Group in the band under the map moves the clock from now to two and six hours later: a zone is back on once its forecast restoration time has passed, and the customers out, the zones back on (with a Progress bar) and the next restoration follow. Choosing a zone, by its pill, its shape or the Native Select, outlines it and flies the map there, and its Steps timeline (reported, crew sent, repairing, back on) marks what has happened by then and what is still a forecast. Built from Map, Toggle Group, Progress, Native Select, Steps, Button and Guides. For utilities, status pages and emergency dashboards.

FAQ

Where do the zones and outages come from, and what stays local?

The suburbs and their borders are real, from OpenStreetMap, simplified so neighbouring zones still share their edges. The outages, causes, customer counts and times in LINES are invented sample data, not advice and not a live feed. Nothing is fetched but the map tiles, and nothing is sent. In your app, fill the same shapes from your outage management system.

How does the clock decide which zones are back on?

Each zone has four typed times: reported, crew sent, repairing and back on, in minutes after midnight. The toggle sets the clock to 14:00, 16:00 or 20:00, and a zone counts as back on once its last time is at or before the clock. Its customers then leave the total, its shading clears and its pill turns to a check; the next restoration is the earliest one still ahead.

How are the zones shaded?

shadeOf puts the customers still out into four steps (under 1,000, then 1,000, 2,000 and 3,000 and over), and the map fills each zone from the chart colours, darkest for the most on a light map and lightest on a dark one, so the worst zone stands out on both; the legend under the map follows the theme too. The count in each pill says the same in numbers.

Can I use it without a mouse?

Yes. The clock is a toggle group, the zone is a native select, and the zoom and reset buttons work from the keyboard; the focused map takes the arrow keys and plus and minus. The pills and the zones on the map are a pointer shortcut to the same choice, and a polite status line gives the zones back on, the customers out and the chosen zone's time once a choice settles.

What does the timeline show?

The four steps of the chosen zone in order, each with its time. A step whose time has passed by the clock is filled with a check, the next one is ringed, and those still ahead say Forecast before their time, so moving the clock moves the timeline with it.

How does it look on a phone?

The map comes first with each pill reduced to its icon, then the clock and the three readouts in a row, then the zone select and its steps running down instead of across, and the legend last. Two fingers pan the map; scrolling over it scrolls the page.