iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

Slider

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.

Explore Custom Slider Ticks on iPhone in portrait, with SwiftUI code and Apple API documentation.

@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)
        }
    }
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ visionOS 26.0+

Every available iPhone screenshot for Custom Slider Ticks.

1 views