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 allStore View
Creates a view to load and merchandise a collection of products from the App Store using product identifiers. Internally, ProductView is used, and therefore productViewStyle can also be applied here.
MenuPickerStyle
A picker style that presents the options as a menu when the user presses a button, or as a submenu when nested within a larger menu.
SegmentedPickerStyle
A picker style that presents the options in a segmented control. Use this style when there are two to five options. Consider using menu when there are more than five options.
ToolbarItem Shared Background Visibility
Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping