uibrik

Split Bar

New

Preview

Customize

Storage

Usage

import { SplitBar } from "@/components/uibrik/split-bar/split-bar";

<SplitBar />

Installation

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

Props

SplitBar
title
Type string
""
Names the whole. Empty uses the sample's name.
showList
Type boolean
true
List every part under the bar.
items
Type { label: string; value: number; color?: string }[]
–
The parts, in bar order. Past six, the rest fold into Other.
total
Type number
–
Full capacity. The rest of the bar shows what's left.
format
Type Intl.NumberFormatOptions
GB for the sample
Formats every number, e.g. { style: "currency", currency: "USD" }.
onSelect
Type (item: SplitItem) => void
–
Called with the part picked from the bar or the list.
className
Type string
–
Classes for the outer shell.