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.
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.
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 |