<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GaugeStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10GaugeStyleP"
  },
  "title" : "GaugeStyle"
}
-->

# GaugeStyle

Defines the implementation of all gauge instances within a view
hierarchy.

```
@MainActor @preconcurrency protocol GaugeStyle
```

## Overview

To configure the style for all the [`Gauge`](/documentation/SwiftUI/Gauge) instances in a view hierarchy,
use the [`gaugeStyle(_:)`](/documentation/SwiftUI/View/gaugeStyle(_:)) modifier. For example, you can configure
a gauge to use the [`circular`](/documentation/SwiftUI/GaugeStyle/circular) style:

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

A type conforming to this protocol inherits `@preconcurrency @MainActor`
isolation from the protocol if the conformance is included in the type’s
base declaration:

```
struct MyCustomType: Transition {
    // `@preconcurrency @MainActor` isolation by default
}
```

Isolation to the main actor is the default, but it’s not required. Declare
the conformance in an extension to opt out of main actor isolation:

```
extension MyCustomType: Transition {
    // `nonisolated` by default
}
```

## Topics

### Getting the automatic style

[`automatic`](/documentation/SwiftUI/GaugeStyle/automatic)

The default gauge view style in the current context of the view being
styled.

### Getting circular gauge styles

[`circular`](/documentation/SwiftUI/GaugeStyle/circular)

A gauge style that displays an open ring with a marker that appears at a
point along the ring to indicate the gauge’s current value.

[`accessoryCircular`](/documentation/SwiftUI/GaugeStyle/accessoryCircular)

A gauge style that displays an open ring with a marker that appears at a
point along the ring to indicate the gauge’s current value.

[`accessoryCircularCapacity`](/documentation/SwiftUI/GaugeStyle/accessoryCircularCapacity)

A gauge style that displays a closed ring that’s partially filled in to
indicate the gauge’s current value.

### Getting linear gauge styles

[`linear`](/documentation/SwiftUI/GaugeStyle/linear)

A gauge style that displays a bar with a marker that appears at a
point along the bar to indicate the gauge’s current value.

[`linearCapacity`](/documentation/SwiftUI/GaugeStyle/linearCapacity)

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

[`accessoryLinear`](/documentation/SwiftUI/GaugeStyle/accessoryLinear)

A gauge style that displays bar with a marker that appears at a
point along the bar to indicate the gauge’s current value.

[`accessoryLinearCapacity`](/documentation/SwiftUI/GaugeStyle/accessoryLinearCapacity)

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

### Creating custom gauge styles

[`makeBody(configuration:)`](/documentation/SwiftUI/GaugeStyle/makeBody(configuration:))

Creates a view representing the body of a gauge.

[`Configuration`](/documentation/SwiftUI/GaugeStyle/Configuration)

The properties of a gauge instance.

[`Body`](/documentation/SwiftUI/GaugeStyle/Body)

A view representing the body of a gauge.

### Supporting types

[`DefaultGaugeStyle`](/documentation/SwiftUI/DefaultGaugeStyle)

The default gauge view style in the current context of the view being
styled.

[`CircularGaugeStyle`](/documentation/SwiftUI/CircularGaugeStyle)

A gauge style that displays an open ring with a marker that appears at a
point along the ring to indicate the gauge’s current value.

[`AccessoryCircularGaugeStyle`](/documentation/SwiftUI/AccessoryCircularGaugeStyle)

A gauge style that displays an open ring with a marker that appears at a
point along the ring to indicate the gauge’s current value.

[`AccessoryCircularCapacityGaugeStyle`](/documentation/SwiftUI/AccessoryCircularCapacityGaugeStyle)

A gauge style that displays a closed ring that’s partially filled in to
indicate the gauge’s current value.

[`LinearGaugeStyle`](/documentation/SwiftUI/LinearGaugeStyle)

A gauge style that displays a bar with a marker that appears at a
point along the bar to indicate the gauge’s current value.

[`LinearCapacityGaugeStyle`](/documentation/SwiftUI/LinearCapacityGaugeStyle)

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

[`AccessoryLinearGaugeStyle`](/documentation/SwiftUI/AccessoryLinearGaugeStyle)

A gauge style that displays bar with a marker that appears at a
point along the bar to indicate the gauge’s current value.

[`AccessoryLinearCapacityGaugeStyle`](/documentation/SwiftUI/AccessoryLinearCapacityGaugeStyle)

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

## Relationships

### Conforming Types

[`AccessoryCircularGaugeStyle`](/documentation/SwiftUI/AccessoryCircularGaugeStyle)

[`AccessoryCircularCapacityGaugeStyle`](/documentation/SwiftUI/AccessoryCircularCapacityGaugeStyle)

[`CircularGaugeStyle`](/documentation/SwiftUI/CircularGaugeStyle)

[`AccessoryLinearGaugeStyle`](/documentation/SwiftUI/AccessoryLinearGaugeStyle)

[`LinearGaugeStyle`](/documentation/SwiftUI/LinearGaugeStyle)

[`LinearCapacityGaugeStyle`](/documentation/SwiftUI/LinearCapacityGaugeStyle)

[`DefaultGaugeStyle`](/documentation/SwiftUI/DefaultGaugeStyle)

[`AccessoryLinearCapacityGaugeStyle`](/documentation/SwiftUI/AccessoryLinearCapacityGaugeStyle)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)