Skip to content

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

Carbon Emissions Map Block for React

England's nine regions as bubbles on a live map, a cut slider from 0 to 40 percent that shrinks them toward their targets, and a card for each region.

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 far a cut goes, with this carbon emissions map for React with Base UI. Cindermark, a carbon accounting tool, totals the yearly emissions of England's nine regions, each a bubble on a live Map that follows your theme, light or dark, its area the megatonnes left after the cut. A Slider in the card floating over the map sets the cut from 0 to 40 percent: every bubble shrinks, the national bar moves against a marker for the national target, and a region turns from a hollow bubble, still above its own target, to a solid one once it meets it. Under the map a card for each region, in step with the bubbles, gives the tonnes left, how far above the target the region is, the smallest cut that meets it and its industry mix in five bars. Choosing a region on the map or its card flies the camera there and marks its card. Built from Map, Slider, Button and Guides. For sustainability teams, reporting tools and climate planners.

FAQ

How are the bubbles sized?

By area, not width: each bubble's side is the square root of the region's megatonnes after the cut, so a region with twice the emissions covers twice the ground. The bubbles keep their size on screen as you zoom, so they stay comparable at every zoom.

How is a target met?

metAt compares the region's emissions after the cut with its own target; the bubble is solid and the card says Target met once they are at or under it. Each card also gives the smallest whole cut that meets the target, worked from the same numbers. The national bar does the same for the sum of the nine against the national target.

How do the cards follow the map?

Choosing a bubble picks its region and marks its card with a rule along its top. From tablet width up the nine cards sit in a grid of three by three; on a phone they are a row that scrolls sideways until the chosen card is in view, never moving the page itself. Each card holds the same five sector bars at the same height whatever the cut, so the cards never change height.

Can I use it without a mouse?

Yes. The slider takes the arrow keys and speaks its value in percent, every region card has a button that picks it and flies the map there, and the zoom and frame buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. A polite message gives the national result and the chosen region once the slider settles.

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

All of it. The regions are real; their tonnes, targets and mixes are typed into the file, and nothing is fetched apart from the map tiles, measured or reported. In your app load the inventory per region from your accounting source and the targets from the plan, and keep afterOf and metAt. The cut applies to every sector equally here; give each sector its own cut by summing them in afterOf.

How does it look on a phone?

The map comes first with smaller bubbles and region codes, the slider card docks under it with the national bar, and the region cards scroll sideways under that, one and a bit at a time.