Components

BaseSegmentBar

A proportional bar of coloured segments, with an optional neutral track for the rest of a total.

components/ui/BaseSegmentBar.vue
View in the demo

Example

Documents 32 GB Images 21 GB Videos 14 GB

Without total the segments fill the bar, as in revenue by country or balance by account; pair it with a BaseLegend (or a list in the same colours) so the colours have names. With total the rest stays as a neutral track, as in storage or seats. Give each segment a label and the bar describes itself to screen readers.

API

Props

Name
Type
Default
Description
segments
required
BaseSegmentBarItem[]—Each { id, value, color, label? }. Zero values are hidden.
totalnumber—A total larger than the sum leaves a neutral track, as in storage or seats.
heightnumber8The bar height.
gapnumber1Space between segments in spacing units (1 = 4px, 0 joins them).
min-widthnumber6Minimum width so small segments stay visible.
labelstring—The accessible name. Without it the bar reads each segment label with its share, such as “Desktop 54%”.
© 2026 melsami UI.
Developer documentation for melsami UI.