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.
Platform Compatibility
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ visionOS 26.0+
Tags
SwiftUI Code
@State private var speed = 42.0
var body: some View {
Slider(value: $speed) {
Text("Foo")
} ticks: {
SliderTick(0.2)
SliderTick(0.6)
SliderTick(0.8)
}
}
Found an issue or have a suggestion?
Created: June 10, 2025Updated: July 24, 2025