Region Map
Where it comes from: a choropleth shaded by the metric you pick, linked to a legend and a ranked list.
Built from RegionMap and RegionMapLegend, SegmentedControl, Combobox, IconButton, Tooltip and Button. The map, the legend and the list are linked: pointing at a state outlines it everywhere and marks its band on the legend; pointing at a legend band fades every state outside it. The data is plain props, so you feed it from your own query.
Revenue by state
Switch the metric, hover a state for its figures and rank, hover a legend band (or click it to hold it), or click a state, or pick one in Find a state. The list is Highest or Lowest, and expands to every state.
Revenue by state
Twelve months to August 31, 2026
- $120K
- $230K
- $760K
- $1.6M
States
Zoomed in
A selected state fills the map. The panel shows its first two metrics as cards, with the rank and how far it is from the average, the others as a line of help text, and the states next to it in the ranking. The ghost zoom-out button (top right) goes back to the whole map.
Revenue by state
Twelve months to August 31, 2026
- $120K
- $230K
- $760K
- $1.6M
Oregon
Compared with the average state- Revenue
- 13th of 51
- $0
- 39% above
- Growth
- 4th of 51
- 0.0%
- +16.6 pts
Penetration 6.5%, 38th of 51, −3.4 pts vs average
Nearby in the ranking
Another country
Pass another country's outlines and the wording follows: “Find a region”, “Show all 12 regions”. The currency and the legend breaks come from your metrics.
Revenue by region
Twelve months to August 31, 2026
- £810K
- £910K
- £1.2M
- £1.6M
Regions
Revenue by state
Twelve months to August 31, 2026
- €800K
- €1.1M
- €1.4M
- €2.4M
States
Loading and empty
Revenue by state
Twelve months to August 31, 2026
- $120K
- $230K
- $760K
- $1.6M
Revenue by state
Twelve months to August 31, 2026
- $120K
- $230K
- $760K
- $1.6M
States
Your data
A COMPOSITION EXAMPLE: copy the folder and replace sample.ts, or pass your own rows and metrics. Each metric names its tab, its unit and how to format and bin it.
The shape of a metric. Row values are keyed by the metric ids.
| Prop | Type | Default | Description |
|---|---|---|---|
| id, label | string | The key into each row's values, and the tab text. | |
| unit | string | What the headline figure means, shown beside it. | |
| format | (n) => string | Formats a value for the headline, the cards, the hover card and the legend. | |
| scale | { breaks, diverging? } | The legend bins. Set diverging for growth-style data. | |
| aggregate | 'sum' | 'mean' | 'sum' | How the headline combines every region when none is selected. |
| compare | (value, average) => string | Words for how a figure compares with the average region. Default: points for a mean metric, a percentage above or below for a sum. |
Accessibility
- The ranked list is the accessible version of the map: every state is a button there with its figure as text.
- Colour is never the only signal: the legend bands are buttons with text labels, comparisons carry an arrow and words, and a state without data has its own “No data” swatch.
- The load animation and the zoom easing are skipped under reduced motion, and the counting figures announce their final value.
- The zoom button has a visible tooltip and an accessible name; Escape also zooms out.
RegionMapBlock props
| Prop | Type | Default | Description |
|---|---|---|---|
| rows | { id, name, values }[] | One row per region. values holds a number for each metric id. Defaults to sample US data. | |
| metrics | RegionMapMetric[] | What the map can be shaded by, in tab order. The first two appear as cards when a region is zoomed; the rest become one line of help text. | |
| regions / viewBox | shapes / [x, y, w, h] | The outlines and their box. Default: the 50 US states. Import another country from @sakaniui/react/regions/… | |
| regionNoun / regionNounPlural | string | 'state' / 'states' | What a region is called in "Find a state", the zoom button and "Show all 51 states". |
| allLabel | string | 'United States' | The name above the headline figure when nothing is zoomed. |
| title / description | string | The heading and the line under it. | |
| state | 'default' | 'loading' | 'empty' | 'default' | Loading draws skeletons; empty says there are no figures yet. |
| defaultMetric | string | The id of the metric shown first. | |
| selectedId / defaultSelectedId / onSelectedChange | string | null | The zoomed region, controlled or not. | |
| animate | boolean | true | Play the load animation: each bar grows from the left while its figure counts up from zero. Off under reduced motion. |
| renderDetail | (row, ctx) => ReactNode | Replaces the zoomed region's panel (the cards, the help text and the nearby list). |
Copy the source
Blocks are composition examples, not configurable components. Rather than adding props for a layout they don't support, copy the file into your own project and edit it: change the columns, swap the sample data, delete the parts you don't need. Nothing here introduces a primitive you can't already import on its own.