SakaniUI

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

United States$0Annual recurring revenue
  • $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

Oregon$0Annual recurring revenue
Back to all states
  • $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

United Kingdom£0KAnnual recurring revenue
  • £810K
  • £910K
  • £1.2M
  • £1.6M

Regions

Revenue by state

Twelve months to August 31, 2026

Germany€0KAnnual recurring revenue
  • €800K
  • €1.1M
  • €1.4M
  • €2.4M

States

Loading and empty

Revenue by state

Twelve months to August 31, 2026

United States—Annual recurring revenue
  • $120K
  • $230K
  • $760K
  • $1.6M

Revenue by state

Twelve months to August 31, 2026

United States—Annual recurring revenue
No figures yet for this period.
  • $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.

PropTypeDefaultDescription
id, labelstringThe key into each row's values, and the tab text.
unitstringWhat the headline figure means, shown beside it.
format(n) => stringFormats 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) => stringWords 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

PropTypeDefaultDescription
rows{ id, name, values }[]One row per region. values holds a number for each metric id. Defaults to sample US data.
metricsRegionMapMetric[]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 / viewBoxshapes / [x, y, w, h]The outlines and their box. Default: the 50 US states. Import another country from @sakaniui/react/regions/…
regionNoun / regionNounPluralstring'state' / 'states'What a region is called in "Find a state", the zoom button and "Show all 51 states".
allLabelstring'United States'The name above the headline figure when nothing is zoomed.
title / descriptionstringThe heading and the line under it.
state'default' | 'loading' | 'empty''default'Loading draws skeletons; empty says there are no figures yet.
defaultMetricstringThe id of the metric shown first.
selectedId / defaultSelectedId / onSelectedChangestring | nullThe zoomed region, controlled or not.
animatebooleantruePlay the load animation: each bar grows from the left while its figure counts up from zero. Off under reduced motion.
renderDetail(row, ctx) => ReactNodeReplaces 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.