<!--
{
  "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/Gauge/init(value:in:label:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5GaugeV5value2in5labelACyxAA9EmptyViewVA2HGqd___SNyqd__GxyXEtcAHRs_AHRs0_AHRs1_SBRd__lufc"
  },
  "title" : "init(value:in:label:)"
}
-->

# init(value:in:label:)

Creates a gauge showing a value within a range and describes the
gauge’s purpose and current value.

```
nonisolated init<V>(value: V, in bounds: ClosedRange<V> = 0...1, @ContentBuilder label: () -> Label) where CurrentValueLabel == EmptyView, BoundsLabel == EmptyView, MarkedValueLabels == EmptyView, V : BinaryFloatingPoint
```

## Parameters

`value`

The value to show in the gauge.

`bounds`

The range of the valid values. Defaults to `0...1`.

`label`

A view that describes the purpose of the gauge.

## Discussion

Use this modifier to create a gauge that shows the value at its
relative position along the gauge and a label describing the gauge’s
purpose. In the example below, the gauge has a range of `0...1`, the
indicator is set to `0.4`, or 40 percent of the distance along the
gauge:

```
struct SimpleGauge: View {
    @State private var batteryLevel = 0.4

    var body: some View {
        Gauge(value: batteryLevel) {
            Text("Battery Level")
        }
    }
}
```

![A linear gauge that shows an indicator at 40 percent along the length](images/com.apple.SwiftUI/SwiftUI-Gauge-ValueLabelLinear@2x.png)

---

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)