[Feature] StackedMeter — segmented capacity indicator (sibling to Meter) #6640
aosmcleod
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Feature description
A StackedMeter component — a segmented horizontal bar that visualises a breakdown of a known capacity. Think storage usage by file type, team capacity by role, language breakdown in a repo, or budget allocation by category.
This is the multi-segment sibling of the existing
Metercomponent. Where Meter shows a single value against a maximum, StackedMeter shows multiple named segments that sum toward a total.Why this belongs in HeroUI
role="group"+ per-segmentrole="meter"), the tooltip integration, the fill animation, and the colour coordination requires enough orchestration that a first-party component saves significant time.aria-hidden(decorative). The root isrole="group"with anaria-label.API design
Data-driven (segments as a prop, not compound children) so the Track, Output, and Legend slots can all read consistent data without a registration pattern:
Compound slots
StackedMeter.OutputStackedMeter.TrackStackedMeter.Legendaria-hidden.Props
segmentsStackedMeterSegment[]maxValuenumber100formatOptionsIntl.NumberFormatOptionssize'sm' | 'md' | 'lg''md'animatebooleantrueSegment type
Visual reference
I have working screenshots from a production implementation of this component. The design matches HeroUI's existing Meter proportions and colour tokens:
Implementation notes
Tooltipfor hover detailstransition: widthwith a staggered delay per segment indexprefers-reduced-motion: reduceskips the animation--accent,--success,--warning,--danger,--default(and could use--info,--noteif [Feature] Extend semantic status colours with --info, --note, and --draft #6563 lands)Prior art
All reactions