Components
BaseMeter
A labelled reading with a bar, for quotas, storage, budgets and limits.
components/ui/BaseMeter.vue
View in the demo
Example
Storage92 / 100 GB
Travel$1,380.00 of $1,200.00
Over by $180.00
Use one per quota or budget line. warnAt switches the bar to warnColor near the limit (plan usage turns warning at 90%); for your own colour rules pass color and leave warnAt out, as the finance budget does (error above the limit with a note). size="small" fits a row of meters in a card; default gives a list more room. The bar never goes past full, so a value above 100 still reads as full while the note explains by how much.
API
Props
Name | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | What is measured, such as "Storage" or a budget category. |
percentrequired | number | — | How full the meter is, from 0 to 100; values above 100 fill the bar. |
value | string | — | The reading next to the label, already formatted, such as "42 / 50 GB". The value slot replaces it. |
color | string | "primary" | The colour of the bar. |
warn-at | number | — | From this percentage on, the bar takes warnColor, so a nearly full quota stands out. |
warn-color | string | "warning" | The colour of the bar from warnAt on. |
size | "default" | "small" | "small" | small for compact rows of meters (plan usage), default for a list with more room (budgets). |
height | number | — | The bar height in pixels; 6 for small and 8 for default when empty. |
note | string | — | A line under the bar, such as "Over by $120". |
note-color | string | — | The colour of the note, such as error; medium emphasis when empty. |
Slots
Name | Slot props | Description |
|---|---|---|
#value | — | Replaces the reading next to the label. |