Stepped Slider
Creates a slider to select a value from a given range, subject to a step increment
Platform Compatibility
Tags
SwiftUI Code
@State private var speed = 40.0
@State private var isEditing = false
var body: some View {
Slider(
value: $speed,
in: 0 ... 100,
step: 10,
label: {
Text("Foo") // for accessibility, enables ticks
},
onEditingChanged: { editing in
isEditing = editing
}
)
}Found an issue or have a suggestion?
More Slider Components
View allSliderTickContentForEach
A type of slider content that creates content by iterating over a collection.
Custom Slider Ticks
Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels and customizable ticks.
Stepped Min Max Label Slider
Creates a slider to select a value from a given range, subject to a step increment, which displays the provided labels
Explore Other Components
Browse allAccessoryCircularCapacityGaugeStyle
A gauge style that displays a closed ring that’s partially filled in to indicate the gauge’s current value
Glass Button Styles
A button style that applies glass border artwork based on the button’s context
Pinned Toolbar Item Placement
A placement that pins the item to the trailing edge of the toolbar.
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