---
title: "Photos Picker Search Text | Explore SwiftUI"
description: "Sets search text of the Photos picker. Learn how to use Photos Picker Search Text in SwiftUI with visual code examples."
canonical_url: "https://exploreswiftui.com/library/photospicker/photos-picker-search-text"
meta:
  author: "Explore SwiftUI"
  "og:description": "Sets search text of the Photos picker. Learn how to use Photos Picker Search Text in SwiftUI with visual code examples."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Photos%2BPicker%2BSearch%2BText%2Cdescription_Sets%2Bsearch%2Btext%2Bof%2Bthe%2BPhotos%2Bpicker.%2Ccategory_PhotosPicker%2Cimage_~L2FwaS9pbWFnZXMvMjgwL3ZhcmlhbnRzLzM0MjI~dj0xNzk2NDgyOTY3OTcxJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_bottom%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiAwOyBib3JkZXItYm90dG9tOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ2aXNpb25PUyJdfQ%2Cp_Ii9saWJyYXJ5L3Bob3Rvc3BpY2tlci9waG90b3MtcGlja2VyLXNlYXJjaC10ZXh0Ig%2Cs_gpDhVK5YVSopncmz.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Photos Picker Search Text | Explore SwiftUI"
  "twitter:description": "Sets search text of the Photos picker. Learn how to use Photos Picker Search Text in SwiftUI with visual code examples."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Photos%2BPicker%2BSearch%2BText%2Cdescription_Sets%2Bsearch%2Btext%2Bof%2Bthe%2BPhotos%2Bpicker.%2Ccategory_PhotosPicker%2Cimage_~L2FwaS9pbWFnZXMvMjgwL3ZhcmlhbnRzLzM0MjI~dj0xNzk2NDgyOTY3OTcxJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_bottom%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiAwOyBib3JkZXItYm90dG9tOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ2aXNpb25PUyJdfQ%2Cp_Ii9saWJyYXJ5L3Bob3Rvc3BpY2tlci9waG90b3MtcGlja2VyLXNlYXJjaC10ZXh0Ig%2Cs_gpDhVK5YVSopncmz.png"
  "twitter:title": "Photos Picker Search Text | Explore SwiftUI"
---

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

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

# **Photos Picker Search Text**

Sets search text of the Photos picker.

![Photos Picker Search Text - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/280/variants/3422?v=1796482967971&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 27.0+ iPadOS 27.0+ macOS 27.0+ visionOS 27.0+

### **Tags**

[**modifier**](https://exploreswiftui.com/?search=modifier "Search for modifier (opens in a new tab)") [**photosPickerSearchText**](https://exploreswiftui.com/?search=photosPickerSearchText "Search for photosPickerSearchText (opens in a new tab)")

### **SwiftUI Code**

[Docs](<https://developer.apple.com/documentation/swiftui/view/photospickersearchtext(_:)>)

```
PhotosPicker("FooBar", selection: $selectedPhoto)
    .photosPickerSearchText("42")
```

### **Found an issue or have a suggestion?**

Created: December 5, 2026Updated: December 5, 2026

### **More PhotosPicker Components **

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

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

### **Inline Photos Picker Style**

A photos picker style that displays the picker inline without presenting a sheet.

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

### **Compact Photos Picker Style**

A photos picker style that displays the picker without presenting a sheet.

![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".

### **Explore Other Components **

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

![Hide Tab Bar On Scroll Down - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/88/variants/383?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Hide Tab Bar On Scroll Down**

Minimize the tab bar when downwards scrolling starts. Minimizing is supported for tab bars on only iPhone

![Custom Placeholder Async URL Image - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/194/variants/275?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Custom Placeholder Async URL Image**

Loads and displays a modifiable image from the specified URL load request using a custom placeholder until the image loads.

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

### **CompactProductViewStyle**

A style for a product view that’s suitable for layouts with less available space, or for displaying more items in a small amount of space.

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

### **Text Tightening**

Sets whether text in this view can compress the space between characters when necessary to fit text in a line.

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

### **UIKit Fill Colors**

![Default Adaptable Tab Bar Placement - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/170/variants/673?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Default Adaptable Tab Bar Placement**

Specifies the default placement for the tabs in a tab view using the adaptable sidebar style.

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

### **Bottom Accessory**

A modifier to place content above the tabs

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

### **SliderTickContentForEach**

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

```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/photos-picker-search-text#webpage","@type":"WebPage","dateModified":"2026-12-05T15:02:47.971Z","datePublished":"2026-12-05T15:01:00.000Z","description":"Sets search text of the Photos picker. Learn how to use Photos Picker Search Text in SwiftUI with visual code examples.","name":"Photos Picker Search Text","url":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text","breadcrumb":{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#article"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/photospicker/photos-picker-search-text"]}],"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/photos-picker-search-text#article","citation":"https://developer.apple.com/documentation/swiftui/view/photospickersearchtext(_:)","dateModified":"2026-12-05T15:02:47.971Z","datePublished":"2026-12-05T15:01:00.000Z","description":"Sets search text of the Photos picker. Learn how to use Photos Picker Search Text in SwiftUI with visual code examples.","headline":"Photos Picker Search Text","inLanguage":"en-US","name":"Photos Picker Search Text","thumbnailUrl":"https://exploreswiftui.com/api/images/280/variants/3422?v=1796482967971&r=2","url":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"hasPart":{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#source-code"},"image":{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#/schema/image/1"},"isPartOf":{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#webpage"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#source-code","@type":"SoftwareSourceCode","codeSampleType":"full example","description":"Sets search text of the Photos picker. Learn how to use Photos Picker Search Text in SwiftUI with visual code examples.","name":"Photos Picker Search Text SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"PhotosPicker(\"FooBar\", selection: $selectedPhoto)\n    .photosPickerSearchText(\"42\")","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"PhotosPicker"},{"@type":"Thing","name":"Photos Picker Search Text"}]},{"@id":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text#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},{"@type":"ListItem","name":"Photos Picker Search Text","item":"https://exploreswiftui.com/library/photospicker/photos-picker-search-text","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/library/photospicker/photos-picker-search-text#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/280/variants/3422?v=1796482967971&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/280/variants/3422?v=1796482967971&r=2"}]}
```