---
title: "init(value:in:label:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/gauge/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.

## Declaration

```swift
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

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")         }     } }

## See Also

### Creating a gauge

- [init(value:in:label:currentValueLabel:)](swiftui/gauge/init(value:in:label:currentvaluelabel:).md)
- [init(value:in:label:currentValueLabel:markedValueLabels:)](swiftui/gauge/init(value:in:label:currentvaluelabel:markedvaluelabels:).md)
- [init(value:in:label:currentValueLabel:minimumValueLabel:maximumValueLabel:)](swiftui/gauge/init(value:in:label:currentvaluelabel:minimumvaluelabel:maximumvaluelabel:).md)
- [init(value:in:label:currentValueLabel:minimumValueLabel:maximumValueLabel:markedValueLabels:)](swiftui/gauge/init(value:in:label:currentvaluelabel:minimumvaluelabel:maximumvaluelabel:markedvaluelabels:).md)
