Marimekko Chart for React
A React Marimekko chart is a 100% stacked mosaic whose columns are as wide as their totals. Pass data as readonly ChartRow[]: one row per column.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/marimekko-chart.jsonSpend by segment and vendor
- Acme (us)
- Northwind
- Contoso
- Others
MarimekkoChartMarimekkoTabledefaultMarimekkoChartLabelsdefaultMarimekkoTableLabels- +2 more
Market map, year on year
Columns are segments sized by total spend; cells are vendors. Switch the year: every cell reshapes in place. Arrow keys move between segments (left / right) and vendors (up / down).
Market map
Spend by segment and vendor, 2025 ($M)
- Acme (us)
- Northwind
- Contoso
- Others
import { ChartCard } from "@/components/sheenui/charts/chart-parts/chart-card";
import { seriesLegend } from "@/components/sheenui/charts/chart-parts/legend-tooltip";
import { type ChartSeries } from "@/components/sheenui/charts/chart-utils";
import { MarimekkoTable, MarimekkoChart } from "@/components/sheenui/charts/marimekko-chart";
// Package build (after the first npm release, or a packed tarball): import { ChartCard, seriesLegend, MarimekkoTable, MarimekkoChart, type ChartSeries } from "@sheenui/theme";
const series: ChartSeries[] = [
{ key: "us", label: "Acme (us)", color: 1 },
{ key: "northwind", label: "Northwind", color: 3 },
{ key: "contoso", label: "Contoso", color: 2 },
{ key: "others", label: "Others", color: 7 },
];
const data = [
{ segment: "Enterprise", us: 910, northwind: 1420, contoso: 1150, others: 820 },
{ segment: "Mid-market", us: 760, northwind: 590, contoso: 700, others: 690 },
{ segment: "SMB", us: 520, northwind: 210, contoso: 350, others: 760 },
{ segment: "Startups", us: 340, northwind: 70, contoso: 80, others: 260 },
];
<ChartCard
title="Market map"
legend={seriesLegend(series, "rect")}
table={<MarimekkoTable data={data} index="segment" indexLabel="Segment" series={series} caption="Spend by segment and vendor" />}
>
<MarimekkoChart
data={data}
index="segment"
series={series}
format={(n) => `$${n}M`}
aria-label="Market spend by segment and vendor, 2025"
/>
</ChartCard>Revenue by region and product, values in the cells
cellText="value" prints each cell’s value instead of its share. Narrow columns keep their name only while it fits; every value stays in the tooltip and the table.
Revenue by region
By product line, fiscal 2025 totals
- Platform
- Analytics
- Services
import { type ChartSeries } from "@/components/sheenui/charts/chart-utils";
import { MarimekkoChart } from "@/components/sheenui/charts/marimekko-chart";
// Package build (after the first npm release, or a packed tarball): import { MarimekkoChart, type ChartSeries } from "@sheenui/theme";
const regions = [
{ region: "North America", platform: 4.8, analytics: 2.1, services: 1.2 },
{ region: "Europe", platform: 3.1, analytics: 1.6, services: 0.9 },
{ region: "Asia Pacific", platform: 1.9, analytics: 1.4, services: 0.3 },
{ region: "Latin America", platform: 0.7, analytics: 0.2, services: 0.2 },
{ region: "Middle East", platform: 0.4, analytics: 0.1, services: 0.1 },
];
const products: ChartSeries[] = [
{ key: "platform", label: "Platform", color: 1 },
{ key: "analytics", label: "Analytics", color: 4 },
{ key: "services", label: "Services", color: 5 },
];
export function Example() {
return (
<MarimekkoChart
data={regions}
index="region"
series={products}
cellText="value"
height={300}
format={(n) => `$${n}M`}
aria-label="Revenue by region and product line"
/>
);
}Files to copy
12 folders · 29 files · 4 packages
- From
theme/src/ components/charts/{marimekko-chart.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-tip.tsx, chart-utils.ts, flow-utils.tsx, heatmap.tsx}components/charts/chart-parts/components/charts/heatmap/components/drawer/parts/sheet.tsxcomponents/kbd/components/menu/components/skeleton/components/status-icons/hooks/{use-controllable.ts, use-intersection.ts, use-latest.ts, use-media-query.ts, use-preferences.ts, use-resolved-scheme.ts}motion/tokens.tslib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/marimekko-chart.jsonRegistry item: marimekko-chart. The styles need the Tailwind v4 glass UI setup.- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".
Props
MarimekkoChartLabels keys and English defaults (6)
MarimekkoTable props
MarimekkoTableLabels keys and English defaults (2)
Keyboard
Accessibility
- The chart is one focusable figure with the role description “marimekko chart”; a cell is announced with its value and both shares (“Enterprise · Acme (us): $910M, 21% of Enterprise, 9% of total”).
- Cell numbers are drawn in black or white, whichever contrasts more with the fill, and only where they fit; the Table view (MarimekkoTable) has every value.
- On touch screens the first tap pins the readout; a second tap activates the cell.
- Reduced motion: the columns appear at once and data changes jump.
All exports on this page
MarimekkoChart— A 100% stacked mosaic whose columns are as wide as their totals: market size and share in one picture (segment × vendor, region × product).MarimekkoTable— Every column with each part's value, the column total and its share of everything.defaultMarimekkoChartLabels— The built-in English strings of MarimekkoChart; spread it into your own labels and change what you need.defaultMarimekkoTableLabels— English defaults of MarimekkoTableLabels.
When to use the marimekko chart
- Use it as a mosaic (mekko) chart for market maps, where each column is a customer segment sized by its revenue and the stacked cells show which product lines or competitors hold that segment.
- It works for a revenue-by-region and product breakdown in a board deck, because column width carries the region's size while cell height carries the product's share inside it.
- Try cellText value when readers want the numbers rather than percentages, for example fiscal revenue per product line printed inside each cell wherever it fits.
- Skip it when you have more than a handful of columns or need exact comparisons across categories; PercentBarChart or a plain BarChart reads more cleanly than narrow columns with clipped text.
- Pair it with ChartCard and its Chart / Table tabs, MarimekkoTable for a text version with totals and shares, and seriesLegend so each stacked part is named once, outside the cells.
Frequently asked questions
Related pages
48 charts pages in all: browse them on Charts.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .