Skip to content

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

Economic Indicators Map Block for React

Ten Asia-Pacific economies on a live map, sized by GDP growth, unemployment or inflation, with trade-flow arcs and a ranked card that flies to each one.

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

Compare one macro indicator across a region at a glance, with this economic indicators map for React with Base UI. Indexmoor, a macro-data desk, puts ten Asia-Pacific economies at their capitals on a live Map that follows your theme, from New Delhi to Wellington. A Toggle Group picks the indicator (GDP growth, unemployment or inflation) and each economy becomes a bubble sized in five steps by its figure, with the number inside; a figure below zero is a hollow, dashed bubble with its minus sign, so a fall reads without colour. A Switch over the map draws trade flows as arcs in four widths by yearly volume, and the chosen economy's arcs stay strong while the rest fade. The card floating at the map's start ranks the ten by the indicator, and choosing an economy, in the card or on the map, flies the camera there and gives its three figures and its biggest trade partner; the globe button frames all ten again. Built from Map, Toggle Group, Switch, Button and Guides. For economics desks, research teams and markets dashboards.

FAQ

Where do the figures come from, and what stays local?

Every figure is typed in the block: the ten economies in LINES (name, capital, its coordinates and the three indicators in tenths of a percent) and the trade volumes in FLOW_LINES. The countries and capitals are real; the figures are invented sample data, not official statistics. Nothing is fetched but the map tiles, and nothing is sent. To use real series, fill the same shapes from your data provider.

How is a bubble's size worked out?

stepOf divides the figure, without its sign, by the largest one for the chosen indicator and puts it in one of five steps, from a small bubble to a large one. A negative figure keeps its size but turns hollow with a dashed ring and a minus sign, and the card prints the same signed figure, so nothing depends on colour.

How are the trade flows drawn?

Each pair in FLOW_LINES is an arc between the two capitals, bowed so crossing lines stay apart. Its width steps up at 50, 100 and 200 billion dollars a year. Arcs touching the chosen economy are drawn strong in the foreground colour and the others fade, so its partners stand out; the biggest of them is named in the card.

Can I use it without a mouse?

Yes. The indicator is a toggle group, the switch is a switch, and every economy in the ranked card is a button that flies the map to it, as clicking its bubble does. The zoom and globe buttons work from the keyboard, and the focused map takes the arrow keys and plus and minus. A polite status line gives the leader, the chosen economy and the flows once a choice settles.

How does the map keep the bubbles clear of the card?

On large screens the card floats over the map's start, so the camera frames the ten capitals in the room to its end, clear of the switch and the zoom buttons too. Pan and zoom freely; choosing an economy flies there, and the globe button aims at all ten again. Scrolling the page over the map scrolls the page: hold Ctrl or ⌘ to zoom.

How does it look on a phone?

The map comes first with the switch over it, and the bubbles shrink to dots without numbers so the close capitals don't overlap. The ranked card docks under the map with the indicator toggle, the ten rows and the chosen economy's figures, and two fingers pan the map.