How to hide the tick marks on a SwiftUI Slider in iOS26

In SwiftUI sliders now have tick marks by default on iOS26, how do you turn them off or hide them? This WWDC talk had some sample code on how to set the tick marks but it doesn't compile for me: https://developer.apple.com/videos/play/wwdc2025/323/

I don't see any available methods or initializers to turn them off.

Answered by markdaws in 850779022

Looks like the ticks parameter is now exposed in beta4. An example from the Apple headers:

     @State private var percentage = 0.5

     Slider(value: $percentage) {
         Text("Percentage")
     } currentValueLabel: {
         Text("\(percentage)%")
     } ticks: {
         SliderTickContentForEach(
             stride(from: 0.0, through: 1.0, by: 0.25).map { $0 },
             id: \.self
         ) { value in
             SliderTick(value) {
                 label(for: value)
             }
         }
     }

The video says they're there when you apply the step parameter. If you're not applying that parameter and the tick marks are there, that suggests a bug.

The video shows a step parameter but it doesn't seem to exist in the current beta build, it doesn't compile.

Accepted Answer

Looks like the ticks parameter is now exposed in beta4. An example from the Apple headers:

     @State private var percentage = 0.5

     Slider(value: $percentage) {
         Text("Percentage")
     } currentValueLabel: {
         Text("\(percentage)%")
     } ticks: {
         SliderTickContentForEach(
             stride(from: 0.0, through: 1.0, by: 0.25).map { $0 },
             id: \.self
         ) { value in
             SliderTick(value) {
                 label(for: value)
             }
         }
     }
How to hide the tick marks on a SwiftUI Slider in iOS26
 
 
Q