Skip to content

Ranked bars

Pro

Parts 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
RankedBars is a list (ul), one item per row; FunnelBars is an ordered list (ol), one item per step, since its steps' order is the meaning.
Accessible name
Named by aria-label or aria-labelledby, or in a ChartFrame by 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 a ChartFrame, 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.noValue and labels.listSeparator (what screen readers hear between a row’s name and its figures, ", " by default), or set them once for the app with a LabelsProvider (its Chart words).
  • In forced-colours mode every bar is CanvasText and the rest row’s bar Canvas with CanvasText dots and a 1px CanvasText outline, 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. Keep classNames overrides from removing them.