Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Power Grid Map Block for React Aria

A single-line diagram of one power station, two transmission and four distribution substations; a demand slider raises every load up to 30 percent, lines over capacity turn dashed and the first to fail is named.

Framework
UI library

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 lines give out first, with this power grid map for React with React Aria. Voltmarsh, a grid operator, draws one generating station, two transmission substations and four distribution substations as squares on a single-line diagram, joined by eight lines whose width is their capacity in megawatts. A Slider raises demand from 0 to 30 percent above today: every substation's load and every line's flow grow by that share, a line over its capacity turns dashed and says "Overloaded", a substation over capacity gets a dashed border and "Over capacity", and the header names the line that goes first and at what percentage. A list of substations with a load meter is the way in: choose one and a card lists its feeders with flow against capacity. It's built from Slider and Guides, with a CSS entrance only. For grid operators, planning tools and utility dashboards.

FAQ

How is an overload decided?

Each line and substation has a typed base value (flow, load) and a cap. At a demand rise the value is the base times one plus the share, and it is over when it passes the capacity. The line that goes first is the one with the smallest ratio of capacity to flow, found once as firstFeeder.

How do I use my own grid?

Edit SUBSTATIONS (a name, a mark, load, capacity and a position in the 480 by 360 units) and FEEDERS (two ends, a flow and a capacity). The diagram, the lists, the meters and the sentence read the same two lists.

Is this a power flow model?

No. Every load grows by the same share and flows are not re-routed when a line is overloaded, so it shows headroom, not what a real grid does. For planning use a load-flow study and keep this block as the display.

Can I use it without a mouse?

Yes. The slider takes the arrow keys and speaks its value, the list of substations is the keyboard route (each row is a button), and the feeders are a plain list that says Overloaded or Within capacity in words. The squares on the diagram are a pointer shortcut and are hidden from assistive technology.

What stays local in the demo, and how do I wire it up?

All of it. The substations, loads and capacities are invented and nothing is switched. In your app feed the lists from your SCADA or asset system and replace the growth rule with a forecast.

How does it look on a phone?

The diagram comes first at a fixed height, the slider sits full width under it, and the two lists stack with fixed row heights, so moving the slider never changes the length of the page.