Proportion Bar
Proportion bar with a legend: storage, budget, breakdown. Pro · Data and metrics › Metrics and widgets
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add proportion-bar
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { ProportionBar } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
segments * | ProportionSegment[] | The parts, drawn left to right; zero or negative values take no space. | |
total | number | Capacity of the bar (100 GB of storage): the rest stays as empty track. Default: the sum of the segments. | |
size | 'sm' | 'md' | 'lg' | 'md' | Bar thickness. Default md. |
showLegend | boolean | true | Dots with names under the bar. Default true. |
showValues | boolean | false | Adds each segment's formatted value to the legend. |
valueFormatter | (value: number) => string | Formats values in the legend and the accessible summary. | |
ariaLabel | string | Accessible name of the bar (the summary of the segments follows it). | |
legendEnd | ReactNode | Content at the end of the legend row: "61.8 GB available". | |
locale | string | BCP 47 locale for the default number format. |
Related components
- Stats Card — Metric cards
- KPI Group — KPI row: value, change vs. previous period, sparkline and progress to goal
- Widget — Dashboard container: title, actions, big number, legend and chart area
- Number Value — Locale-aware number: currency, percent, compact notation and units
- Trend Value — Metric change: arrow, sign and color, as text or a pill
- Activity Rings — Concentric progress rings toward goals
- Leaderboard — Leaderboard: medal places, thumbnails, numbers and change over a period
- Data Table — Tables with search and sorting
- Data Grid — Grid for 100,000 rows: grouping, filters, inline editing
- Virtual List — Virtual list for 100,000 rows
- Bulk Action Bar — Actions for selected rows, with keyboard shortcuts
- List Block — List with images or icons, descriptions and values
Previous: Trend Value · Next: Activity Rings · All Data and metrics