Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
One rounded bar split into parts, with each part's value and share below.
npx shadcn@latest add ikislay/pixel-ui/segmented-barimport { SegmentedBar } from "@/components/ui/segmented-bar"const data = [{ label: "Photos", value: 48 },{ label: "Apps", value: 31 },{ label: "Music", value: 12 },]export function Demo() {return <SegmentedBar label="Storage by type" data={data} format={(n) => n + " GB"} />}
1// Loading…
Options you can pass to customize this component.
data*{ label: string; value: number; color?: string }[]One part per entry, left to right. Colors follow the chart palette in order unless you set one.
label*stringNames the chart for screen readers and captions its data table.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
classNamestringMerged onto the root element.