shadcn.io is an independent project built on shadcn/ui
On this page5 sections
Installation
Overview
Compare states on one number, with this census data map for React with Base UI. Ledgerstone, a regional statistics atlas, draws the eight states of the US Mountain West at their real borders on a live Map that follows your theme, light or dark. A Native Select floating over the map switches the indicator between Population, Median income, Median age and Growth from 2010 to 2020, and each state is shaded by its fifth among the eight on the theme's chart ramp: darker for higher on a light map, brighter for higher on a dark one. Every state carries a pill with its code and, from tablet width, its figure, and the legend under the map gives the five ranges in words, highest first. The rail at the start ranks the states with a bar each; pressing a row, a pill or the state itself outlines it on the map and fills the card with its rank, its figure, its gap to the median and the median itself. Built from Map, Native Select and Guides. For statistics offices, public data portals and policy dashboards.
FAQ
How are the five shades chosen?
rankingOf sorts the states by the chosen figure and gives each a level from its place in the order, floor((7 - position) * 5 / 8), so the eight fall into fifths of 1, 2, 1, 2 and 2 from the top. It is a quantile scheme, not equal-width steps, so Wyoming's small population does not squeeze the other seven into the top shades. The legend reads each fifth's lowest and highest figure from the same ranking, so it always matches the map.
How is the gap to the median worked out?
With eight states the median is the mean of the fourth and fifth figures, and a state's gap is its figure minus that median, shown with a sign: millions for population, thousands of dollars for income, years for age and percentage points for growth.
Where do the borders and figures come from, and what stays local?
The borders are Natural Earth's public-domain US states, simplified and typed into RINGS, so nothing is fetched besides the basemap tiles, which come from CARTO over OpenStreetMap data. The figures are rounded sample values typed into LINES, not official statistics. Nothing you choose is sent or saved.
Can I use it without a mouse?
Yes. The indicator is a native select with a visible label, and every state is a button in the ranked rail with its pressed state; the zoom buttons work from the keyboard, and the map takes the arrow keys and plus and minus once focused. The pills and the states on the map are a pointer shortcut to the same choice. A polite message gives the chosen state's rank and gap once the choice settles.
Why do the shades turn round in a dark theme?
On a dark basemap the light end of a ramp is the one that stands out, so stepColorOf reads the map's theme and turns the chart colours round: the darkest for the top fifth on a light map, the lightest on a dark one. The legend's swatches turn round with the page's theme in the same way, so the two always agree, in any preset.
How does it look on a phone?
The map comes first with the select over its top and each pill cut to the state's code, so eight pills never crowd; then the legend in five narrow cells, then the ranked rail and the state's card. Scrolling the page over the map scrolls the page; use two fingers to pan it, and the plus and minus buttons to zoom.





