Components

Bar List

new

Ranked horizontal bars with a label and a value on each row.

PageVisitors
  • /4,120
  • /docs/getting-started2,840
  • /blocks1,630
  • /docs/components/button1,210
  • /pricing754

Installation

npx shadcn@latest add @blank/bar-list

Usage

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

PropTypeDefault
data{ name, value, key?, href?, icon? }[]—
valueFormatter(value: number) => stringtoLocaleString
sortOrder"descending" | "ascending" | "none""descending"
onValueChange(item) => void—
showAnimationbooleanfalse