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.
Keyboard
None. Ranked and funnel bars are lists of text with nothing to focus, so they have no keys.
Screen reader
- Role
RankedBarsis a list (ul), one item per row;FunnelBarsis an ordered list (ol), one item per step, since its steps' order is the meaning.- Accessible name
- Named by
aria-labeloraria-labelledby, or in aChartFrameby its title; a development build warns about one with no name. - States announced
- Each item reads its name and its amount as text, apart ("Paris, 1,204"), in the order drawn: largest first with the rest last, or a funnel's steps in their order. A funnel step after the first also reads its share of the step before ("Paid, 548, 90% of the step before",
labels.ofPrevious).
- The bars are hidden from assistive tech (
aria-hidden); the amounts say the same. - An amount that isn't a number reads
labels.noValue("No value"), never "NaN".
Focus
None. Nothing in them takes focus: every row is text.
Touch target
None. They have nothing to press; every figure is printed beside its bar.
Motion
- The bars grow from nothing one after another when the list first comes into view, then a change moves every bar at once, on the default spatial spring. Under reduced motion they take their lengths at once, with no stagger.
- A list on screen as the page hydrates shows its bars from the server's HTML and doesn't replay.
What you need to do
- Name each list with
aria-label("Orders by city"), or put it in aChartFrame, whose title names it. - Mark the remainder with
rest("Everywhere else"), so it stays last and is read last. - Keep a funnel's steps in the order people take them; it never sorts them.
- Labels are text, never HTML; a long one wraps rather than being cut, so it can say all it needs.
- Translate
labels.ofPrevious,labels.noValueandlabels.listSeparator(what screen readers hear between a row’s name and its figures, ", " by default), or set them once for the app with aLabelsProvider(itsChartwords). - In forced-colours mode every bar is
CanvasTextand the rest row’s barCanvaswithCanvasTextdots and a 1pxCanvasTextoutline, while names, amounts and a funnel’s shares take the system text colour; the rest row is told apart by its name and its place, last, too. KeepclassNamesoverrides from removing them.