Zephora UI

Other

MeterGroup

Stacked meter showing how multiple values share one total, with an automatic color palette and an optional legend with percentages.

Import

import { MeterGroup } from "@zephora/react";

Examples

Basic

Without `max`, the scale defaults to the sum of all item values.

  • Apps46
  • Photos32
  • System22

Fixed max and percentages

With `max` the bar can be partially filled; `showLabels` adds percentages to the legend.

  • Used210 (41%)
  • Cache96 (19%)

Custom colors and sizes

  • Passed180
  • Skipped24
  • Failed6

API

MeterGroup props

PropTypeDefaultDescription
items *Array<{ label: string; value: number; color?: string }>Segments to stack. Colors default to the built-in palette.
maxnumberScale total. Defaults to the sum of all item values.
showLegendbooleantrueRenders the legend under the bar.
showLabelsbooleanfalseRenders each item's percent inside the legend.
size"sm" | "md" | "lg""md"Track thickness.
orientation"horizontal""horizontal"Layout of the bar. Only horizontal is supported.
aria-labelstring"Meter group"Accessible name of the group.
unstyledbooleanfalseHeadless mode — skips Zephora styling.