---
title: "SliderTickContentForEach | Explore SwiftUI"
description: "A type of slider content that creates content by iterating over a collection. Learn how to use SliderTickContentForEach in SwiftUI with visual code examples."
canonical_url: "https://exploreswiftui.com/library/slider/slidertickcontentforeach"
meta:
  author: "Explore SwiftUI"
  "og:description": "A type of slider content that creates content by iterating over a collection. Learn how to use SliderTickContentForEach in SwiftUI with visual code examples."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_SliderTickContentForEach%2Cdescription_A%2Btype%2Bof%2Bslider%2Bcontent%2Bthat%2Bcreates%2Bcontent%2Bby%2Biterating%2Bover%2Ba%2Bcollection.%2Ccategory_Slider%2Cimage_~L2FwaS9pbWFnZXMvMTMzL3ZhcmlhbnRzLzM3OT92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3NsaWRlci9zbGlkZXJ0aWNrY29udGVudGZvcmVhY2gi%2Cs_eNqDJPm1laHcQ0f3.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "SliderTickContentForEach | Explore SwiftUI"
  "twitter:description": "A type of slider content that creates content by iterating over a collection. Learn how to use SliderTickContentForEach in SwiftUI with visual code examples."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_SliderTickContentForEach%2Cdescription_A%2Btype%2Bof%2Bslider%2Bcontent%2Bthat%2Bcreates%2Bcontent%2Bby%2Biterating%2Bover%2Ba%2Bcollection.%2Ccategory_Slider%2Cimage_~L2FwaS9pbWFnZXMvMTMzL3ZhcmlhbnRzLzM3OT92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3NsaWRlci9zbGlkZXJ0aWNrY29udGVudGZvcmVhY2gi%2Cs_eNqDJPm1laHcQ0f3.png"
  "twitter:title": "SliderTickContentForEach | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=133)

# **SliderTickContentForEach**

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

![SliderTickContentForEach - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/133/variants/379?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

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

### **Tags**

### **SwiftUI Code**

[ Docs](https://developer.apple.com/documentation/swiftui/slidertickcontentforeach)

```
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](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

### **More Slider Components **

[**View all **](https://exploreswiftui.com/library/slider)

![Custom Slider Ticks - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/86/variants/375?v=1790073478842&r=2&w=412&q=75&f=webp)

### **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](https://exploreswiftui.com/api/images/52/variants/335?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Slider Color**

Customizing the color of the slider

![Stepped Min Max Label Slider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/51/variants/396?v=1790073478842&r=2&w=412&q=75&f=webp)

### **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](https://exploreswiftui.com/api/images/50/variants/273?v=1790073478842&r=2&w=412&q=75&f=webp)

### **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](https://exploreswiftui.com/api/images/49/variants/249?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Slider**

Creates a slider to select a value from a given range

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![Color Gradient - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/15/variants/143?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Gradient**

The Color gradient modifier

![DatePicker Colors - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/66/variants/245?v=1790073478842&r=2&w=412&q=75&f=webp)

### **DatePicker Colors**

Customizing the colors of the date picker

![Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/34/variants/408?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Button Tint**

Sets the buttons tint color

![Disclosure Group - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/131/variants/363?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Disclosure Group**

A view that shows or hides another content view, based on the state of a disclosure control.

![Increased Header Prominence - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/108/variants/331?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Increased Header Prominence**

Sets the header prominence to increased for this view.

![ButtonToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/210/variants/635?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ButtonToggleStyle**

A toggle style that displays as a button with its label as the title.

![Toolbar Item Visibility Priority - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/238/variants/733?v=1792389091475&r=2&w=412&q=75&f=webp)

### **Toolbar Item Visibility Priority**

Defines the visibility priority for a toolbar item.

![List Row Insets - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/109/variants/281?v=1790073478842&r=2&w=412&q=75&f=webp)

### **List Row Insets**

Applies an inset to the rows in a list.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/slider/slidertickcontentforeach#webpage","@type":"WebPage","dateModified":"2025-12-26T07:19:17.462Z","datePublished":"2025-12-25T18:54:52.802Z","description":"A type of slider content that creates content by iterating over a collection. Learn how to use SliderTickContentForEach in SwiftUI with visual code examples.","name":"SliderTickContentForEach","url":"https://exploreswiftui.com/library/slider/slidertickcontentforeach","breadcrumb":{"@id":"https://exploreswiftui.com/library/slider/slidertickcontentforeach#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/slider/slidertickcontentforeach"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/slider/slidertickcontentforeach#article","dateModified":"2025-12-26T07:19:17.462Z","datePublished":"2025-12-25T18:54:52.802Z","description":"A type of slider content that creates content by iterating over a collection. Learn how to use SliderTickContentForEach in SwiftUI with visual code examples.","headline":"SliderTickContentForEach","inLanguage":"en-US","name":"SliderTickContentForEach","thumbnailUrl":"https://exploreswiftui.com/api/images/133/variants/379?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/slider/slidertickcontentforeach","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/slider/slidertickcontentforeach#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/slider/slidertickcontentforeach#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/slidertickcontentforeach","codeSampleType":"full example","description":"A type of slider content that creates content by iterating over a collection. Learn how to use SliderTickContentForEach in SwiftUI with visual code examples.","name":"SliderTickContentForEach SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"Slider(value: $percentage) {\n            Text(\"Percentage\")\n        } currentValueLabel: {\n            Text(\"\\(percentage)%\")\n        } ticks: {\n            SliderTickContentForEach(\n                stride(from: 0.0, through: 1.0, by: 0.25).map { $0 },\n                id: \\.self\n            ) { value in\n                SliderTick(value) {\n                    Text(\"value: \\(value * 100)%\")\n                }\n            }\n        }\n        .padding(.horizontal)","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Slider"},{"@type":"Thing","name":"SliderTickContentForEach"}]},{"@id":"https://exploreswiftui.com/library/slider/slidertickcontentforeach#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Slider","item":"https://exploreswiftui.com/library/slider","position":2},{"@type":"ListItem","name":"SliderTickContentForEach","item":"https://exploreswiftui.com/library/slider/slidertickcontentforeach","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/133/variants/379?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/133/variants/379?v=1790073478842&r=2"}]}
```