Skip to content

Meter Group

Partition one exact shared capacity into ordered named measurements.

Usage

Grouped capacity

Partition one shared capacity into ordered named measurements and explicit remaining space.

Storage capacityPartition one shared capacity into ordered named measurements and explicit remaining space.80 / 100 GB

Zero values

Keep zero-valued categories in order without assigning them visual capacity.

Storage capacityKeep zero-valued categories in order without assigning them visual capacity.42 / 100 GB

Exact decimal

Enter 0.1 as decimal text and preserve it without binary floating-point coercion.

Storage capacityEnter 0.1 as decimal text and preserve it without binary floating-point coercion.0.3 / 0.6 GB

Invalid input

Reject a partition whose exact total exceeds the shared capacity.

Storage capacityReject a partition whose exact total exceeds the shared capacity.80 / 100 GB

Rejected input: meter-group-total-exceeds-maximum

API

Vue package: @sectile/vue/meter-group

Components
  • MeterGroupRoot
  • MeterGroupTrack
  • MeterGroupSegment
  • MeterGroupIndicator
  • MeterGroupValueText
  • MeterGroupList
  • MeterGroupItem
  • MeterGroupItemIndicator
  • MeterGroupItemLabel
  • MeterGroupItemValue

Props

MeterGroupRootProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

formatTotal

Formats the aggregate value and maximum for visible text.

formatValue

Formats a value for visible text.

high

Lower boundary of the high-value region.

items

Ordered item values managed by the component.

label

Accessible name announced for the control.

low

Upper boundary of the low-value region.

max

Largest value accepted by the component.

optimum

Value that determines which threshold region is optimal.

MeterGroupSegmentProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

id

Stable ID used to connect related parts.

MeterGroupItemProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

id

Stable ID used to connect related parts.

MeterGroupPartProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

Slots

MeterGroupSegmentSlotProps

end

Segment end value within the shared range.

endPercentage

Segment end expressed as a percentage of the shared range.

id

Stable ID for this field or item.

label

Accessible name announced for the control.

percentage

Current value expressed as a percentage of its range.

start

Segment start value within the shared range.

startPercentage

Segment start expressed as a percentage of the shared range.

value

Current value exposed by this contract.

valueText

Formatted text for the current range value when available.

MeterGroupRootSlotProps

max

Maximum of the numeric range.

percentage

Current value expressed as a percentage of its range.

remaining

Unallocated value remaining before the shared maximum.

segments

Ordered segments projected from the shared range.

total

Sum of all segment values.

valueText

Formatted text for the current range value when available.

zone

Quality region derived from the thresholds and optimum value.

MeterGroupItemSlotProps

end

Segment end value within the shared range.

endPercentage

Segment end expressed as a percentage of the shared range.

id

Stable ID for this field or item.

label

Accessible name announced for the control.

percentage

Current value expressed as a percentage of its range.

start

Segment start value within the shared range.

startPercentage

Segment start expressed as a percentage of the shared range.

value

Current value exposed by this contract.

valueText

Formatted text for the current range value when available.

Other types

MeterGroupEntry

NameTypeRequired
idstringYes
valuenumber | stringYes
labelstringYes

MeterGroupValueFormatter

ts
type MeterGroupValueFormatter = (value: string, entry: MeterGroupEntry) => string

MeterGroupTotalFormatter

ts
type MeterGroupTotalFormatter = (total: string, max: string) => string

Parts

Shared scope: [data-scope="meter-group"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
root[data-part="root"]Names the related set without adding a duplicate aggregate meter.role="group"
data-zone="<zone>"
data-percentage="<percentage>"
track[data-part="track"]Preserves the ordered visual track while its meter children retain semantics.role="presentation"
segment[data-part="segment"]Exposes one named measurement and its exact cumulative offsets.role="meter"
data-id="<id>"
data-start-percentage="<percentage>"
data-end-percentage="<percentage>"
indicator[data-part="indicator"]Draws the current segment without adding another accessible value.aria-hidden="true"
data-percentage="<percentage>"
value-text[data-part="value-text"]Displays the formatted value as text.
list[data-part="list"]Groups the visual legend without repeating the named meter announcements.aria-hidden="true"
item[data-part="item"]Keeps one legend row keyed to the same Core segment.data-id="<id>"
aria-hidden="true"
item-indicator[data-part="item-indicator"]Shows the item selection state.
item-label[data-part="item-label"]Exposes the item label styling region.
item-value[data-part="item-value"]Exposes the item value styling region.

Keyboard interaction

KeyBehavior
NoneThe range display is read-only and defines no keyboard interaction.

Accessibility

One named group contains ordered, individually named read-only meters; visual track and legend parts add no duplicate aggregate announcement.

Released under the MIT License.