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.
201elements
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.
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)
}
}Compatibility
iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ visionOS 26.0+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for Custom Slider Ticks.