<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.2.0",
    "iPadOS: 13.0.0 - 27.2.0",
    "macCatalyst: 13.0.0 - 27.2.0",
    "macOS: 10.15.0 - 27.2.0",
    "visionOS: 1.0.0 - 27.2.0",
    "watchOS: 6.0.0 - 27.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Slider/init(value:in:step:onEditingChanged:minimumValueLabel:maximumValueLabel:label:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI6SliderV5value2in4step16onEditingChanged17minimumValueLabel07maximumkL05labelACyxq_GAA7BindingVyqd__G_SNyqd__G6StrideQyd__ySbcq_q_xyXEtcSBRd__SBAQRQlufc"
  },
  "title" : "init(value:in:step:onEditingChanged:minimumValueLabel:maximumValueLabel:label:)"
}
-->

# init(value:in:step:onEditingChanged:minimumValueLabel:maximumValueLabel:label:)

Creates a slider to select a value from a given range, subject to a
step increment, which displays the provided labels.

```
nonisolated init<V>(value: Binding<V>, in bounds: ClosedRange<V>, step: V.Stride = 1, onEditingChanged: @escaping (Bool) -> Void = { _ in }, minimumValueLabel: ValueLabel, maximumValueLabel: ValueLabel, @ContentBuilder label: () -> Label) where V : BinaryFloatingPoint, V.Stride : BinaryFloatingPoint
```

## Parameters

`value`

The selected value within `bounds`.

`bounds`

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

`step`

The distance between each valid value.

`onEditingChanged`

A callback for when editing begins and ends.

`minimumValueLabel`

A view that describes `bounds.lowerBound`.

`maximumValueLabel`

A view that describes `bounds.upperBound`.

`label`

A `View` that describes the purpose of the instance. Not all
slider styles show the label, but even in those cases, SwiftUI
uses the label for accessibility. For example, VoiceOver uses the
label to identify the purpose of the slider.

## Discussion

The `value` of the created instance is equal to the position of
the given value within `bounds`, mapped into `0...1`.

The slider calls `onEditingChanged` when editing begins and ends. For
example, on iOS, editing begins when the user starts to drag the thumb
along the slider’s track.

---

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)