SegmentedBar

One bar split by share, like a storage meter. Segments unfold in turn; point at one and it grows. Charts.

Open playground
  • Photos64 GB 46%
  • Apps38 GB 28%
  • Documents22 GB 16%
  • System14 GB 10%

About

SegmentedBar is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { SegmentedBar } from "@ashutoshswamy/smoui" and set data, prefix.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { SegmentedBar } from "@ashutoshswamy/smoui";

<SegmentedBar suffix=" GB" data={[{ label: "Photos", value: 64 }, { label: "Apps", value: 38 }]} />

Props 2

data

Segments, largest first.

{ label: string; value: number }[]
prefix / suffix

Wrap values, or pass `format`.

string