Stars and capacity bars are one control family: the level indicator
Level Indicator
/ NSLevelIndicator · NSLevelIndicator.Style /
also called level meter, capacity indicator, rating indicator, relevancy indicator
A level indicator shows a value inside a known range rather than the progress of an ongoing task. Its native styles cover continuous or segmented capacity bars, symbol-based ratings such as stars, and compact relevance meters. Warning and critical thresholds can change the capacity indicator's color as the value crosses them.
If you called it…
…you meant Level Indicator.
Anatomy — every part, named
- 1Filled level
NSLevelIndicator.doubleValue“The colored amount inside the little meter” is the filled level.
- 2Warning threshold
NSLevelIndicator.warningValue“The point where the meter changes to a warning color” is the warning threshold.
- 3Critical threshold
NSLevelIndicator.criticalValue“The point where the bar turns critical” is the critical threshold.
- 4Rating symbol
NSLevelIndicator.Style.rating“Each star in the rating row” is a rating symbol in the level indicator.
Prompt — paste into your agent
Use an NSLevelIndicator with the style that matches the meaning: .continuousCapacity or .discreteCapacity for a bounded level, .rating for stars, or .relevancy for match strength. Configure warningValue and criticalValue for native threshold coloring; SwiftUI's nearest general equivalent is Gauge.
Debug prompt — when it misbehaves
Paste this, then describe what you’re seeing — it hands your agent the classic failure modes to rule out first.
Debug my macOS level indicator (NSLevelIndicator). Rule out: the wrong style — continuous capacity vs discrete ticks vs rating stars are one class with different levelIndicatorStyle values; warning and critical thresholds recoloring the fill unexpectedly; isEditable letting clicks change the value when it should be display-only; value changes not animating because the cell redraws instantly. The symptom:
In code
The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).
| AppKit | NSLevelIndicator | |
| AppKit | NSLevelIndicator.Style | |
| SwiftUI | Gauge |