Ranked bars
ProParts compared on one scale, largest first, with the rest in one row last; and a funnel's steps with each one's share of the step before. Not an M3 component (@windmorph/react-pro).
import { RankedBars, FunnelBars } from '@windmorph/react-pro/charts';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Props
RankedBars 13 props
The parts to compare, each
keyonce; ranked largest first unlesssortisnone.descendingputs the largest first;nonekeeps the app's order.Formats an amount.
Ref to the outermost element.
The outermost element's id.
Text
Words it shows ("No value" for an amount that isn't a number). A
LabelsProvidersets them for the whole app.labels.describePlacetype(place: string, values: readonly ChartPlaceValue[], total: { label: string; value: string; } | undefined) => stringdefault"{place}: {label} {value}, {label} {value}. {total.label} {total.value}"What a place says to assistive technology as the keyboard reaches it: its name, then each series on show with its value, then the total where the series add up, with its word (
total).Before the sum in the readout and the description.
For a place a series has no value at, and what a chart with no places (or no parts) says from the keyboard.
Names the legend.
Said of the one series a legend still shows, whose chip can't hide it.
Names a segmented bar's key to its parts.
The part the parts past those drawn fold into (more than six, or five
ordered).labels.describeParttype(label: string, value: string, share: string, position: number, count: number) => stringdefault"{label}: {value}, {share}, {position} of {count}"A part, as the slider's value text says it: its name, amount and share, and where it is among the parts (
positionofcount).A funnel step's share of the one before.
In a table view, the column of a chart's places, unless the chart names it.
In a table view, the column of a whole's parts.
In a table view, the column of the parts' amounts.
What screen readers hear between a list row's name and its figures, never shown: a
SegmentedListrow's name, share and amount, aRankedBarsorFunnelBarsrow's name, amount and note, so they're read apart.
Names the list. In a
ChartFrame, its title does unless this is given.The id of what names it.
The id of what describes it.
The id of what gives more about it.
Classes for each part.
Each row's name.
Each amount.
Each bar's track, the length every bar is measured against.
The list of rows.
Each row: its name, bar and amount.
Each bar.
Classes for the outermost element. Wins over the defaults via
cn().Inline styles for the outermost element.
Also accepts the root element's HTML attributes (id, data-*, event handlers).
FunnelBars 13 props
The steps, in the order people take them; never ranked.
Formats an amount.
Ref to the outermost element.
The outermost element's id.
Text
Words it says. A
LabelsProvidersets them for the whole app.labels.describePlacetype(place: string, values: readonly ChartPlaceValue[], total: { label: string; value: string; } | undefined) => stringdefault"{place}: {label} {value}, {label} {value}. {total.label} {total.value}"What a place says to assistive technology as the keyboard reaches it: its name, then each series on show with its value, then the total where the series add up, with its word (
total).Before the sum in the readout and the description.
For a place a series has no value at, and what a chart with no places (or no parts) says from the keyboard.
Names the legend.
Said of the one series a legend still shows, whose chip can't hide it.
Names a segmented bar's key to its parts.
The part the parts past those drawn fold into (more than six, or five
ordered).labels.describeParttype(label: string, value: string, share: string, position: number, count: number) => stringdefault"{label}: {value}, {share}, {position} of {count}"A part, as the slider's value text says it: its name, amount and share, and where it is among the parts (
positionofcount).A funnel step's share of the one before.
In a table view, the column of a chart's places, unless the chart names it.
In a table view, the column of a whole's parts.
In a table view, the column of the parts' amounts.
What screen readers hear between a list row's name and its figures, never shown: a
SegmentedListrow's name, share and amount, aRankedBarsorFunnelBarsrow's name, amount and note, so they're read apart.
Names the list. In a
ChartFrame, its title does unless this is given.The id of what names it.
The id of what describes it.
The id of what gives more about it.
Classes for each part.
The list of rows.
Each row: its name, bar and amount.
Each row's name.
Each bar's track, the length every bar is measured against.
Each bar.
Each amount.
A funnel step's share of the one before.
Classes for the outermost element. Wins over the defaults via
cn().Inline styles for the outermost element.
Also accepts the root element's HTML attributes (id, data-*, event handlers).
Spec status
Not part of Material Design 3: a Windmorph Pro component, built on M3's colour roles, type scale, shapes and motion. Its variants and configurations each link to a live example.
| Item | Status | Details |
|---|---|---|
Largest first, with the rest last (RankedBars, rest) | Built | Variant · Cities |
Steps with each one’s share of the step before (FunnelBars) | Built | Variant · Funnel |
| A narrow container: names on a line of their own | Built | Configuration · Narrow |
| Built on M3’s foundations, for charts | Extension | M3 has no charts. The bars take the charts’ first colour slot, built from the theme’s primary, with the rest row in the quiet colour, M3’s type scale for names and amounts, and the spatial spring. |
Largest first, with the rest last (
BuiltRankedBars,rest)Variant · Cities
Steps with each one’s share of the step before (
BuiltFunnelBars)Variant · Funnel
A narrow container: names on a line of their own
BuiltConfiguration · Narrow
Built on M3’s foundations, for charts
ExtensionM3 has no charts. The bars take the charts’ first colour slot, built from the theme’s primary, with the rest row in the quiet colour, M3’s type scale for names and amounts, and the spatial spring.
Theming & tokens
Set the tokens below on the list or any ancestor; both components share them. The bars' colour is the charts' first slot, --wm-chart-color-1, and the rest row's is --wm-chart-quiet. className goes on the root. Style each part with classNames: list, row, name, track, bar, figure, and on a funnel also note, each step's share of the one before.
| Variable | Default | Paints |
|---|---|---|
--wm-bar-list-thickness | 12px | Each bar’s thickness. |
--wm-bar-list-corner | var(--md-sys-shape-corner-extra-small) | A bar’s data end; its start stays square on the baseline. |
--wm-bar-list-row-gap | 12px | The space between rows. |
--wm-bar-list-column-gap | 12px | The space between the names, the bars and the amounts. |
--wm-bar-list-line-gap | 4px | The space between a row’s lines: its bar under its name in a narrow list, a funnel step’s share under its bar. |
--wm-bar-list-name-width | 14rem | The most the names’ column takes before the bars. |
--wm-bar-list-name-color | var(--md-sys-color-on-surface) | Each row’s name. |
--wm-bar-list-figure-color | var(--md-sys-color-on-surface) | Each row’s amount. |
--wm-bar-list-grow-duration | var(--md-sys-motion-spring-spatial-default-duration) | How long a bar takes to grow to a new amount, one row after another as the list is first seen. |
--wm-bar-list-grow-easing | var(--md-sys-motion-spring-spatial-default-easing) | The easing of that change. |
--wm-bar-list-note-color | var(--md-sys-color-on-surface-variant) | A funnel step’s share of the one before. |