Dot Bars
For top pages, countries or referrers: biggest first, and past the row limit the tail folds into one Other row so the list never runs on. Each bar is lit in the accent for its share of the biggest, the last dot only partly, with the rest of the row dark dots like an LED panel that's off. Rows fill in from the top when it comes into view and slide to their new lengths when the data changes; point at one and the others dim while its share of the whole appears beside its value.
Needs: None. Canvas 2D.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| data | { label: string; value: number }[] | required | The items and their values, in any order. |
| max | number | 8 | Most rows shown; the rest fold into one “Other” row. |
| format | (value: number) => string | – | How a value reads. |
| tone | string | – | The bars' colour. The page's accent by default. |
| pitch | number | 3 | Size of one dot in px. |
| thickness | number | 3 | How many dots tall a bar is. |
| label | string | "Bars" | What the list shows, for screen readers. |
| onSelect | (item: { label: string; value: number }) => void | – | Called when a row is clicked. Rows become buttons when it's set. |
| className | string | – | Class on the list. It fills its container's width. |
| style | CSSProperties | – | Style on the list. |