Ranked breakdown where each row's tinted bar shows its size against the biggest row, with underline tabs between lists and a "Show more" for long ones.
Tabbed lists
Underline Tabs switch between lists; each row's bar is its size against the biggest row and the number is its share of the list. Rows can lead with an avatar or logo.
Invoiced this year
- Denzing41% ($148,200)
- Halo Coffee25% ($92,400)
- Northwind17% ($61,800)
- Fernway Studio11% ($38,600)
- Juniper Health6% ($21,400)
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add bar-list-cardBrings the 10 files it builds on (button.tsx, glyph.tsx, chart.tsx, badge.tsx, dropdown-menu.tsx, icon.tsx, floating.tsx, segmented-control.tsx, tabs.tsx, skeleton.tsx). The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/bar-list-card.tsx.
import { BarListCard } from "@/design-system/components/bar-list-card";Usage
<BarListCard
title="Invoiced this year"
metricLabel="Invoiced"
format={(n) => formatMoney(n)}
tabs={[
{ id: "clients", label: "Clients", items: [{ label: "Denzing", value: 148200 }, …] },
{ id: "services", label: "Services", items: […] },
]}
/>Examples
One list, raw values
Pass items and title for a single list; metric="value" prints the formatted value. Lists longer than limit show a "Show more" button.
Overdue invoices
Owed- Halo Coffee · INV-2041$12,800
- Northwind · INV-2037$9,400
- Juniper Health · INV-2052$6,200
- Denzing · INV-2049$4,750
Single grey ink
color="neutral" paints every bar in a soft grey, for a calm secondary card.
Where enquiries come from
Enquiries- Referrals40% (46)
- Website form27% (31)
- Dribbble16% (18)
- LinkedIn11% (12)
- Events6% (7)
When to use
Use it when
- Ranking items by one number: revenue by client, hours by person, enquiries by source
- Several related breakdowns in one card behind tabs (Clients / Services / Team)
Don’t use it when
- A trend over time → Area chart card
- Steps that people drop out of → Funnel chart card
- Many columns per row → Table
Rules
- Biggest first (the default sort); keep labels short, they truncate on the bar
- metric="share" (default) for parts of a whole, metric="value" when the raw number matters (money owed)
- Show 5 rows by default (`limit`); longer lists get a "Show more" button
- One tint per card: brand by default, a status colour when the list is one (rose for overdue), neutral for a calm secondary card
Properties
BarListCard
| Prop | Type | Default |
|---|---|---|
title * | string | – |
items | BarListItem[] | – |
tabs | BarListTab[] | – |
tab | string | – |
defaultTab | string | – |
onTabChange | (id: string) => void | – |
metricLabel * | string | – |
metric | "share" | "value" | "share" |
format | NumberFormat | formatNumber |
limit | number | 5 |
color | ChartColor | "brand" |
sort | boolean | true |
headingLevel | 2 | 3 | 4 | 3 |
className | string | – |
* required
Accessibility
- A real list: every row reads as its label and number; with metric="share" the value follows in visually hidden text
- Tabs are the Avesk Tabs (arrow keys, tab/tabpanel wiring); the card is a section named by its title
- "Show more" is a button with aria-expanded and aria-controls on the list
- Bars are decorative (aria-hidden); the grow-in animation only runs without prefers-reduced-motion