data/@mihcm/ui·v0.21.0·stable
CategoryBar
Segmented distribution bar for allocation, status, and risk summaries with optional legend and tokenized segment classes.
Props
The full prop API for CategoryBar. Same surface in web and React Native — bundlers pick the right variant via the react-native export condition.
| Prop | Type | Default | Description | Since |
|---|---|---|---|---|
data | CategoryBarItem[] | — | Segments with label, value, and optional className. | 0.12.0 |
valueFormatter | (value: number, percentage: number) => ReactNode | — | Formats legend values. | 0.12.0 |
showLegend | boolean | true | Show or hide the legend. | 0.12.0 |
legendPosition | 'top' | 'bottom' | 'bottom' | Legend placement relative to the bar. | 0.12.0 |
barClassName | string | — | Tokenized Tailwind classes for the track. | 0.12.0 |
className | string | — | Additional Tailwind classes on the root wrapper. | 0.12.0 |
Import
import { CategoryBar } from '@mihcm/ui/CategoryBar';