<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/SearchSuggestionsPlacement",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI26SearchSuggestionsPlacementV"
  },
  "title" : "SearchSuggestionsPlacement"
}
-->

# SearchSuggestionsPlacement

The ways that SwiftUI displays search suggestions.

```
struct SearchSuggestionsPlacement
```

## Overview

You can influence which modes SwiftUI displays search suggestions for by
using the [`searchSuggestions(_:for:)`](/documentation/SwiftUI/View/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`](/documentation/SwiftUI/EnvironmentValues/searchSuggestionsPlacement) environment value in your
search suggestions.

## Topics

### Getting placements

[`static var automatic: SearchSuggestionsPlacement`](/documentation/SwiftUI/SearchSuggestionsPlacement/automatic)

Search suggestions render automatically based on the surrounding
context.

[`static var content: SearchSuggestionsPlacement`](/documentation/SwiftUI/SearchSuggestionsPlacement/content)

Search suggestions render in the main content of the app.

[`static var menu: SearchSuggestionsPlacement`](/documentation/SwiftUI/SearchSuggestionsPlacement/menu)

Search suggestions render inside of a menu attached to the search field.

### Supporting types

[`struct Set`](/documentation/SwiftUI/SearchSuggestionsPlacement/Set)

An efficient set of search suggestion display modes.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)