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
Platform Compatibility
Tags
SwiftUI Code
@State private var speed = 42.0
@State private var isEditing = false
var body: some View {
Slider(
value: $speed,
in: 0 ... 100,
step: 10 // optional, by default 1,
) {
Text("Foo") // for accessibility
} minimumValueLabel: {
Text("0")
} maximumValueLabel: {
Text("100")
} onEditingChanged: { editing in // optional
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 Slider
Creates a slider to select a value from a given range, subject to a step increment
Explore Other Components
Browse allNavigation Split View Container Background
A background placement behind the content of a NavigationSplitView.
Tab View Customization
Specifies the customizations to apply to the sidebar representation of the tab view.
Default Tab Bar Placement
Specifies the preferred placement for the tabs of a TabView in the sidebarAdaptable style on platforms where the tab bar cannot adapt between different representations, and only one representation can be shown. For example, on iOS, it can enforce the sidebar on large-screen devices like the Pro Max, and iPhone Duo. This modifier has no effect on iPadOS.
Sheet Background Interaction
Controls whether people can interact with the view behind a presentation.