Contents

accessoryLinearCapacity

A gauge style that displays bar that fills from leading to trailing edges as the gauge’s current value increases.

Declaration

@MainActor @preconcurrency static var accessoryLinearCapacity: AccessoryLinearCapacityGaugeStyle { get }

Discussion

Apply this style to a Gauge or to a view hierarchy that contains gauges using the gaugeStyle(_:) modifier:

Gauge(value: batteryLevel, in: 0...100) {
    Text("Battery Level")
}
.gaugeStyle(.accessoryLinearCapacity)

If you provide minimumValueLabel and maximumValueLabel parameters when you create the gauge, they appear on leading and trailing edges of the bar, respectively. The label appears above the gauge, and the currentValueLabel appears below.

See Also

Getting linear gauge styles