Messages
MeterGroup
Several values on one bar, with a legend, read out as a single total.
WAI-ARIA tested
Import
main.ts
import { MeterGroup } from '@vitral/vue';Basic
- Apps14%
- Messages12%
- Media24%
- System10%
Label first, custom colours
- Done45%
- In review20%
- Blocked5%
Vertical
- Apps14%
- Messages12%
- Media24%
- System10%
API
Read from packages/vue/src/components/MeterGroup/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| value | MeterItem[] | — |
| min | number | Defaults to 0. |
| max | number | Defaults to 100. |
| orientation | 'horizontal' | 'vertical' | — |
| labelPosition | 'start' | 'end' | The legend after the track (the default) or before it. |
| labelOrientation | 'horizontal' | 'vertical' | How the legend is laid out. Defaults to across, or down for a vertical meter. |
| valueTemplate | string | How a value is written, in the legend and to assistive technology. `{value}` is a percentage. Defaults to `'{value}%'`. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| label | (props: { value: MeterItem[]; totalPercent: number; percentages: number[] }) | Replaces the legend. |
| icon | (props: { value: MeterItem; index: number }) | An item's icon or marker. |
| start | (props: { totalPercent: number }) | — |
| end | (props: { totalPercent: number }) | — |