---
title: "PhotosPicker Components | Explore SwiftUI"
description: "A view that displays a Photos picker for choosing assets from the photo library. Explore 9 SwiftUI photospicker components with visual code examples."
canonical_url: "https://exploreswiftui.com/library/photospicker"
meta:
  author: "Explore SwiftUI"
  "og:description": "A view that displays a Photos picker for choosing assets from the photo library. Explore 9 SwiftUI photospicker components with visual code examples."
  "og:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_PhotosPicker%2BComponents%2Cdescription_Explore%2B9%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L3Bob3Rvc3BpY2tlciI%2Cs_F1S7E9_P0c_yevPB.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "PhotosPicker Components | Explore SwiftUI"
  "twitter:description": "A view that displays a Photos picker for choosing assets from the photo library. Explore 9 SwiftUI photospicker components with visual code examples."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_PhotosPicker%2BComponents%2Cdescription_Explore%2B9%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L3Bob3Rvc3BpY2tlciI%2Cs_F1S7E9_P0c_yevPB.png"
  "twitter:title": "PhotosPicker Components | Explore SwiftUI"
---

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

# **PhotosPicker Components**

A view that displays a Photos picker for choosing assets from the photo library.

9 components

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

### **Photos Picker**

Creates a picker with a title key and selection, and optionally configures the types of items to show and item encoding behavior.

![Photos Picker Title - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/270/variants/2261?v=1794910543223&r=2&w=412&q=75&f=webp)

### **Photos Picker Title**

Overrides the title of the Photos picker. The title is not visible on small screens, like the iPhone.

![Photos Picker Prompt - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/269/variants/2259?v=1794910719258&r=2&w=412&q=75&f=webp)

### **Photos Picker Prompt**

Sets the prompt of the Photos picker.

![On Secondary Photos Picker Action - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/268/variants/2255?v=1794910758520&r=2&w=412&q=75&f=webp)

### **On Secondary Photos Picker Action**

Sets the secondary action handler for the Photos picker.

![On Primary Photos Picker Action - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/267/variants/2251?v=1794910789851&r=2&w=412&q=75&f=webp)

### **On Primary Photos Picker Action**

Sets the primary action handler for the Photos picker.

![Container Photo Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/266/variants/2243?v=1794910698423&r=2&w=412&q=75&f=webp)

### **Container Photo Picker**

Limits the Photos picker to only show items in the specified container. In this case, to the user-created album "CustomAlbum".

![Custom Photo Picker Buttons - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/265/variants/2235?v=1794910823065&r=2&w=412&q=75&f=webp)

### **Custom Photo Picker Buttons**

Sets the primary and secondary button types of the Photos picker.

![Disable Automatic Photos Picker Dismissal - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/264/variants/2231?v=1794910665768&r=2&w=412&q=75&f=webp)

### **Disable Automatic Photos Picker Dismissal**

Prevents the Photos picker from dismissing automatically. Without this modifier, the Photos picker would automatically dismiss when an image is tapped.

![Range Photo Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/263/variants/2229?v=1794910645062&r=2&w=412&q=75&f=webp)

### **Range Photo Picker**

Presents a Photos picker that selects a collection of PhotosPickerItem, constrained to a range of selection counts.

```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/photospicker#webpage","description":"A view that displays a Photos picker for choosing assets from the photo library. Explore 9 SwiftUI photospicker components with visual code examples.","inLanguage":"en-US","name":"PhotosPicker Components","url":"https://exploreswiftui.com/library/photospicker","@type":["WebPage","CollectionPage"],"about":{"@id":"https://developer.apple.com/documentation/swiftui"},"breadcrumb":{"@id":"https://exploreswiftui.com/library/photospicker#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/photospicker#itemlist"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/photospicker"]}],"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/photospicker#itemlist","@type":"ItemList","name":"PhotosPicker Components","numberOfItems":9,"itemListElement":[{"@type":"ListItem","position":1,"name":"Photos Picker","url":"https://exploreswiftui.com/library/photospicker/photos-picker"},{"@type":"ListItem","position":2,"name":"Photos Picker Title","url":"https://exploreswiftui.com/library/photospicker/photos-picker-title"},{"@type":"ListItem","position":3,"name":"Photos Picker Prompt","url":"https://exploreswiftui.com/library/photospicker/photos-picker-prompt"},{"@type":"ListItem","position":4,"name":"On Secondary Photos Picker Action","url":"https://exploreswiftui.com/library/photospicker/on-secondary-photos-picker-action"},{"@type":"ListItem","position":5,"name":"On Primary Photos Picker Action","url":"https://exploreswiftui.com/library/photospicker/on-primary-photos-picker-action"},{"@type":"ListItem","position":6,"name":"Container Photo Picker","url":"https://exploreswiftui.com/library/photospicker/container-photo-picker"},{"@type":"ListItem","position":7,"name":"Custom Photo Picker Buttons","url":"https://exploreswiftui.com/library/photospicker/custom-photo-picker-buttons"},{"@type":"ListItem","position":8,"name":"Disable Automatic Photos Picker Dismissal","url":"https://exploreswiftui.com/library/photospicker/disable-automatic-photos-picker-dismissal"},{"@type":"ListItem","position":9,"name":"Range Photo Picker","url":"https://exploreswiftui.com/library/photospicker/range-photo-picker"}]},{"@id":"https://exploreswiftui.com/library/photospicker#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"PhotosPicker","item":"https://exploreswiftui.com/library/photospicker","position":2}]},{"@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"}]}
```