Skip to content

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

Renewable Energy Map Block for React

Twelve solar, wind and hydro sites across Spain on a live map, their halos resized by a time-of-day toggle, with a stacked mix bar against demand.

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 how a portfolio's output follows the clock, with this renewable energy map for React with Base UI. Fieldwatt, a renewable portfolio, runs twelve sites across Spain, four solar farms, four wind farms and four dams, each at its real place on a live Map that follows your theme, drawn as a sun, wind or water icon badge with a halo as wide as what it makes. A Toggle Group in the bar over the map steps through Midnight, 06:00, Noon and 18:00 and the halos grow and shrink from typed profiles: solar follows the sun and goes dashed at night, wind barely moves and hydro is held back for the evening peak. The bar says how much of demand is met, such as "118% of demand met at noon", and under the map a stacked bar splits the output into solar, wind and hydro in three weights of foreground against a line for the demand at that hour, with a legend in megawatts. Three lists, one per kind, give every site's output against its capacity; choosing a site there or on the map flies the camera to it. Built from Map, Toggle Group, Button and Guides. For energy portfolios, grid operators and sustainability reports.

FAQ

How is the output worked out?

Each site makes its capacity times its kind's share for the hour, from PROFILES: solar 0, 12, 78 and 26 percent through the day, wind 52, 46, 38 and 44, hydro 35, 60, 45 and 85. The total over the typed DEMAND for that hour, rounded to a whole percent, is the share met; at 18:00 it falls short as the sun sets. These are sample figures, not a forecast.

Why are the halos sized by a square root?

A halo's width grows with the square root of the megawatts, so its area, which is what the eye compares, follows the output. A site that makes nothing at that hour has no halo and a dashed badge, and every figure is also in its list row and its tooltip.

How do I read the mix bar without colour?

The three kinds are three weights of foreground, dark, mid and light, always in the same order, and the legend under the bar names each with its megawatts. The bar keeps one scale, 2,400 MW, at every hour so its length can be compared, and the demand is a thin upright line whose figure is in the legend. The bar itself is decoration; every number is in text.

Where does the data come from, and what stays local?

The twelve places are real and typed in LINES with an invented capacity; Fieldwatt, the profiles and the demand are invented too. Only the map tiles are loaded, CARTO's free basemaps over OpenStreetMap data with their credit kept, and nothing is measured or sent.

Can I use it without a mouse?

Yes. The time toggle is one tab stop and takes the arrow keys, and each site in the three lists is a button with a pressed state that flies the map to it; the badges on the map are a pointer shortcut to the same choice. The map button frames every site again, and a polite message speaks the new mix once the hour is chosen.

How does it look on a phone?

The time toggle and the share met sit above the map, the halos draw smaller, and the mix bar, its legend and the three lists stack under it. The page keeps the same length at every hour.