# Split Bar

> Parts of a whole on one bar, linked to a list, with segments that slide to new shares when the data changes.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Blocks › Charts |
| Live preview | https://uibrik.com/components/split-bar |
| Writes | 1 files into `components/uibrik/split-bar/`, plus `components/uibrik/_charts/chart-kit.tsx` |
| Packages | `@number-flow/react`, `@tabler/icons-react`, `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/split-bar.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/split-bar`.

Can't run commands? https://uibrik.com/components/split-bar/prompt-full.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
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={…}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/split-bar.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `title` | `string` | `""` | Names the whole. Empty uses the sample's name. |
| `showList` | `boolean` | `true` | List every part under the bar. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `items` | `{ label: string; value: number; color?: string }[]` |  | The parts, in bar order. Past six, the rest fold into Other. |
| `total` | `number` |  | Full capacity. The rest of the bar shows what's left. |
| `format` | `Intl.NumberFormatOptions` | `GB for the sample` | Formats every number, e.g. { style: "currency", currency: "USD" }. |
| `onSelect` | `(item: SplitItem) => void` |  | Called with the part picked from the bar or the list. |
| `className` | `string` |  | Classes for the outer shell. |

## Where it fits

- **Storage breakdowns**: Parts of a whole on one bar linked to a list make usage by type clear. Pairs with [Progress](https://uibrik.com/components/progress.md).
- **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](https://uibrik.com/components/ring-stack.md) (Pro).

## Same shelf: Charts

- [Stacked Bars](https://uibrik.com/components/stacked-bars.md) (Pro): Monthly columns split by series that slide apart into groups, with a legend that folds series away.
- [Stock Chart](https://uibrik.com/components/stock-chart.md) (Pro): A live candlestick stock chart with seven ranges, volume, RSI and moving averages, earnings markers, drag-to-measure and key statistics.
- [Table Chart](https://uibrik.com/components/table-chart.md) (Pro): A table whose share bars lift out one by one and swing upright into the bars of a chart, while the labels and headers slide into place as its axes.
- [Tide Chart](https://uibrik.com/components/tide-chart.md) (Pro): A streamgraph of flowing bands: point at one to follow it, click it to fold the rest away, click again to open it into its parts, in shades of its colour.
- [Area Chart](https://uibrik.com/components/area-chart.md): A time-series chart with soft area washes and one crosshair that reads every series at once.
- [Bar List](https://uibrik.com/components/bar-list.md): A ranked list of top pages, referrers or countries whose rows slide to their new rank and resize when you switch lists.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/split-bar/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
