Interactive previews iPhone

SliderTickContentForEach

A type of slider content that creates content by iterating over a collection.

SliderTickContentForEach - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 26.0+ iPadOS 26.0+ macOS 26.0+ watchOS 26.0+ visionOS 26.0+

Tags

SwiftUI Code

Docs
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) {
                    Text("value: \(value * 100)%")
                }
            }
        }
        .padding(.horizontal)

Found an issue or have a suggestion?

Created: December 25, 2025Updated: December 26, 2025
Connect Wizard

Connect Wizard

Unlock insights App Store Connect doesn’t show you.

Get Started

More Slider Components

View all
Custom Slider Ticks - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

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.

Slider Color - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Slider Color

Customizing the color of the slider

Stepped Min Max Label Slider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

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

Stepped Slider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Stepped Slider

Creates a slider to select a value from a given range, subject to a step increment

Slider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Slider

Creates a slider to select a value from a given range

Explore Other Components

Browse all
Button Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Styles

A type that applies standard interaction behavior and a custom appearance to all buttons within a view hierarchy

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Container Content Margins

Adds the margins of the container the view is in.

Vertical Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Vertical Divider

A vertical visual element that can be used to separate other content

Wheel Picker Item Height - watchOS - Liquid Glass - Light Mode - Preview
modifier

Wheel Picker Item Height

Sets the default wheel-style picker item height.

CircularGaugeStyle - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
style

CircularGaugeStyle

A gauge style that displays an open ring with a marker that appears at a point along the ring to indicate the gauge’s current value

AccessoryCircularCapacityGaugeStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

AccessoryCircularCapacityGaugeStyle

A gauge style that displays a closed ring that’s partially filled in to indicate the gauge’s current value

Button Border Shape - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Button Border Shape

A shape used to draw a button’s border.

DatePicker Colors - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

DatePicker Colors

Customizing the colors of the date picker