components / bar-list
bar-list.
ranked horizontal bar list — each row's proportional bar is the row's own background, with the label on the left and the value right-aligned. rows can link out or fire a click handler; per-item colors are opt-in and tinted back so labels stay legible.
installation
bunx @justin06lee/chrome@latest add bar-listprops
| name | type | default | description |
|---|---|---|---|
| items * | BarListItem[] | - | rows in render order. BarListItem is { id?, label, value, color?, href? }. sort before passing — limit keeps the first N, not the largest N. |
| max | number | - | bar scale ceiling; defaults to the largest value present. |
| formatValue | (value: number) => string | String | value formatter for the right column. |
| showValue | boolean | true | show the value column; when false it stays available to screen readers. |
| limit | number | - | render at most this many rows. |
| onItemClick | (item: BarListItem) => void | - | makes rows buttons; ignored on rows that carry an href. |
| linkComponent | React.ElementType | 'a' | anchor element/component for rows with an href — pass your router's Link. |
| className | string | - |