Bar List

Pro

Ranked rows with a bar sized to each value, for top categories, app usage, votes and standings. Bars grow in one after another, and rows re-rank smoothly when values change.

Preview

Installation

npx @lumioui/cli add pro/bar-list

Usage

import { BarList } from "@/components/ui/bar-list/bar-list";
<BarList />

Examples

Leaderboard

A step challenge between friends.

Poll results

A cycling club's Saturday route vote in a group chat.

Screen time

A digital-wellbeing report.

Spending categories

"where it went" on a banking insights page.

API reference

Prop Type Default
items* BarListItem[] —
max number

Value that fills a whole bar. Default: the largest value.

—
sort "desc" | "none"

"desc" ranks by value (rows re-rank on change). Default "desc".

"desc"
rank boolean

Rank numbers before each row.

false
layout "track" | "fill"

Bar placement. Default "track".

"track"
tint BarListTint

Default bar/disc tint. Default "primary".

"primary"
leadingShape "circle" | "square"

Leading tile shape. Default "circle".

"circle"
formatValue (value: number) => string

Format values. Default locale number.

(v) => v.toLocaleString("en-US")
onItemPress (item: BarListItem) => void

Row press — makes rows buttons.

—
selectedKey string | null

Key of the row shown as selected.

—
className string —
leadKey string | null

Key of the row the viewer just chose (a vote, a pick). On the next value change its bar lights first and holds before the other bars grow.

—