---
title: SearchSuggestionsPlacement
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/searchsuggestionsplacement
---

# SearchSuggestionsPlacement

The ways that SwiftUI displays search suggestions.

## Declaration

```swift
struct SearchSuggestionsPlacement
```

## Overview

Overview You can influence which modes SwiftUI displays search suggestions for by using the searchSuggestions(_:for:) modifier: enum FruitSuggestion: String, Identifiable {     case apple, banana, orange     var id: Self { self } }

@State private var text = "" @State private var suggestions: [FruitSuggestion] = []

var body: some View {     MainContent()         .searchable(text: $text) {             ForEach(suggestions) { suggestion in                 Text(suggestion.rawValue)                     .searchCompletion(suggestion.rawValue)             }             .searchSuggestions(.hidden, for: .content)         } } In the above example, SwiftUI only displays search suggestions in a suggestions menu. You might want to do this when you want to render search suggestions in a container, like inline with your own set of search results. You can get the current search suggestion placement by querying the searchSuggestionsPlacement environment value in your search suggestions.

## Topics

### Getting placements

- [automatic](swiftui/searchsuggestionsplacement/automatic.md)
- [content](swiftui/searchsuggestionsplacement/content.md)
- [menu](swiftui/searchsuggestionsplacement/menu.md)

### Supporting types

- [SearchSuggestionsPlacement.Set](swiftui/searchsuggestionsplacement/set.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Making search suggestions

- [Suggesting search terms](swiftui/suggesting-search-terms.md)
- [searchSuggestions(_:)](swiftui/view/searchsuggestions(_:).md)
- [searchSuggestions(_:for:)](swiftui/view/searchsuggestions(_:for:).md)
- [searchCompletion(_:)](swiftui/view/searchcompletion(_:).md)
- [searchable(text:tokens:suggestedTokens:placement:prompt:token:)](swiftui/view/searchable(text:tokens:suggestedtokens:placement:prompt:token:).md)
