Black Friday: 30% off Pro

Get 30% off

Updated

Split Bar

Preview

Customize

Storage

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.

Too large to paste whole, so Copy prompt gives a short prompt that installs it with the CLI. Download the full prompt to attach it instead.

Usage

import { SplitBar } from "@/components/uibrik/split-bar/split-bar";​const items = [  { label: "Photos", value: 38.4 },  { label: "Documents", value: 21.7 },  // …3 more];​<SplitBar  title=""  showList  items={items}  onSelect={(item) => {}}  // total={0}  // format={…}/>

Where to use Split Bar

  • Storage breakdowns

    Parts of a whole on one bar linked to a list make usage by type clear.

    Pairs with Progress

  • Survey results

    Segments sliding to new shares when data changes show shifts in opinion.

  • Plan or category splits

    One bar is more compact than a pie chart in a dashboard card.

    Pairs with Ring Stack

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.