Bar List
newRanked horizontal bars with a label and a value on each row.
PageVisitors
Installation
npx shadcn@latest add @blank/bar-listUsage
import { BarList } from "@/components/ui/bar-list"<BarList
data={[
{ name: "/", value: 4120 },
{ name: "/pricing", value: 754 },
]}
/>Bars are drawn relative to the largest value and sorted largest first; set
sortOrder="none" to keep your order. Any non-zero value keeps a sliver of bar
so small rows never look empty.
Examples
Clickable rows
With onValueChange every row becomes a button. A row with an href renders
as a link instead, so a row never nests one control inside another.
Pick a source to filter.
API Reference
| Prop | Type | Default |
|---|---|---|
data | { name, value, key?, href?, icon? }[] | — |
valueFormatter | (value: number) => string | toLocaleString |
sortOrder | "descending" | "ascending" | "none" | "descending" |
onValueChange | (item) => void | — |
showAnimation | boolean | false |