uibrik

Bar List

New

Preview

Customize

Limit6
Number
Accent

Usage

import { BarList } from "@/components/uibrik/bar-list/bar-list";

<BarList />

Installation

npx shadcn@latest add https://uibrik.com/r/bar-list.json
Adds the files to components/uibrik/bar-list and installs @number-flow/react, @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/bar-list.

Props

BarList
title
Type string
"Top sources"
Names the list.
limit
Type number
6
Rows shown before the rest fold into Other.
showShare
Type boolean
false
Show each row's share of the total.
accent
Type string
""
Bar colour. Empty uses the chart palette.
groups
Type { value: string; label: string; items: { label: string; value: number; href?: string }[] }[]
–
Lists to switch between, each with its own tab.
items
Type { label: string; value: number; href?: string }[]
–
A single list. Replaces groups and hides the tabs.
unit
Type string
"visitors"
What the headline counts.
format
Type Intl.NumberFormatOptions
{}
Formats every number, e.g. { notation: "compact" }.
onSelect
Type (item: BarListItem) => void
–
Makes rows buttons and is called with the chosen item.
className
Type string
–
Classes for the outer shell.