A stacked meter that shows multiple values as proportional segments of one bar. Pass an array of { label, value, color?, icon? } items. Segment widths are relative to the sum of values, or to an optional max total.
Default meter with a color legend (values and percentages).
Set icon on each item to show a base-icon in the legend (colored with stroke-*).
Use size — sm, md (default), lg, or xl.
sm
md
lg
xl
Pass [max] when segments should fill only part of a known capacity (e.g. 72 of 100 GB used). Unused space stays as the track background.
Storage used: 72 / 100 GB
Toggle showLegend, showValue, and showPercent.
Run the following command to add this component to your project:
npx base-ui-cli add meter-group
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add meter-group
// Paths are relative to aliases.components (default: src/app/components)
import { MeterGroupComponent } from './meter-group/meter-group.component';
@Component({
selector: 'app-your-component',
imports: [
MeterGroupComponent
],
template: `...`
})
export class YourComponent {} API for meter-group — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
base-meter-group | value | MeterGroupItem[] | [] | Segments to render. Widths are proportional to each item's `value` relative to `max` (or the sum of values when `max` is unset). |
base-meter-group | size | MeterGroupSize | 'md' | Thickness of the meter bar. |
base-meter-group | max | number | undefined | undefined | Optional total baseline. When omitted, the sum of segment values is used. |
base-meter-group | showLegend | boolean | true | Whether to render the legend under the bar. |
base-meter-group | showValue | boolean | true | Whether legend rows show the absolute value. |
base-meter-group | showPercent | boolean | true | Whether legend rows show the percentage share. |
base-meter-group | class | string | '' | Extra host classes merged via `cn()`. |
Content