Skip to content
misoto22 design

Data

BarList

A ranked list, with the bar behind the name rather than beside it.

When to reach for it

Top referrers, slowest endpoints, biggest accounts. A horizontal BarChart spends a third of its width on an axis repeating labels the rows could simply contain.

Examples

default

Top referrers
NameValue
google.com42.1K
github.com18.8K
news.ycombinator.com9,400
x.com6,120
reddit.com3,280
lobste.rs1,940
bsky.app1,100
linkedin.com640

limit

Top referrers
NameValue
google.com42.1K
github.com18.8K
news.ycombinator.com9,400
Other13.1K

Notes

A ranked list, with the bar behind the name rather than beside it.

The answer to "top referrers", "slowest endpoints", "biggest accounts" — and a better one than a horizontal bar chart, which spends a third of its width on a category axis repeating labels the rows could simply contain. Reading a name off a y-axis and matching it to a bar is two steps; reading it off the bar is none.

It is a <table>, because that is what it is: two columns, a header, and one row per thing. The bar is a background on the name cell, so it never becomes a second element a screen reader has to walk past.

Reach for <BarChart orientation="horizontal"> instead when the categories are few and fixed and the axis is doing real work — a scale a reader needs to read values off, rather than a ranking they need to skim.

Props

BarList props
PropTypeDefaultDescription
itemsrequiredBarListItem[]
labelrequiredstringWhat the list ranks. Required: it names the table for a screen reader.
classNamestring
formatValue(value: number) => stringdefaultTickFormats each value. Defaults to the same compact form the axes use.
limitnumberKeeps the top N and folds the rest into one "Other" row.
maxnumberThe scale's ceiling. Derived from the largest row when omitted. Pin it to compare two lists side by side — on independent scales the leading row of each fills its track, and two very different numbers look identical.
showLabelbooleanfalsePrints the label above the list instead of hiding it from sight.
sortbooleantrueSorts descending before rendering.

Accessibility

  • A real <table> with two columns and one row per thing, because that is what a ranked list is. The bar is a background on the name cell, so it is never a second element a screen reader has to walk past.
  • limit sums the tail into an “Other” row rather than dropping it — a top five that silently discards the other forty misstates the whole, and the reader has no way to tell.
  • Pin max to compare two lists side by side: on independent scales the leading row of each fills its track, and two very different numbers look identical.