<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/textInputSuggestions(_:id:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE20textInputSuggestions_2id7contentQrqd___s7KeyPathCy7ElementQyd__qd_0_Gqd_1_AJctSkRd__SHRd_0_AaBRd_1_r1_lF"
  },
  "title" : "textInputSuggestions(_:id:content:)"
}
-->

# textInputSuggestions(_:id:content:)

Configures the text input suggestions for this view.

```
nonisolated func textInputSuggestions<Data, ID, Content>(_ data: Data, id: KeyPath<Data.Element, ID>, @ContentBuilder content: @escaping (Data.Element) -> Content) -> some View where Data : RandomAccessCollection, ID : Hashable, Content : View
```

## Parameters

`data`

The data that is used to create views dynamically.

`id`

The key path to the provided data’s identifier.

`content`

The content builder that creates views dynamically.

## Discussion

You can suggest text completions during a text input operation by
providing data to this modifier. The interface presents the suggestion
views as a list of choices when someone activates the text editing
interface.

Associate a string with each suggestion view by adding the
[`textInputCompletion(_:)`](/documentation/SwiftUI/View/textInputCompletion(_:)) modifier to the view.

Use `Label` to get platform-standard visual representations of
suggestion text accompanied with images, and `Section` for labelled
sections of results.

---

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)