---
title: "searchable(text:tokens:suggestedTokens:placement:prompt:token:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/searchable(text:tokens:suggestedtokens:placement:prompt:token:)"
---

# searchable(text:tokens:suggestedTokens:placement:prompt:token:)

Marks this view as searchable with text, tokens, and suggestions.

## Declaration

```swift
nonisolated func searchable<C, T, S>(text: Binding<String>, tokens: Binding<C>, suggestedTokens: Binding<C>, placement: SearchFieldPlacement = .automatic, prompt: S, @ContentBuilder token: @escaping (C.Element) -> T) -> some View where C : MutableCollection, C : RandomAccessCollection, C : RangeReplaceableCollection, T : View, S : StringProtocol, C.Element : Identifiable

```

## Parameters

- `text`: The text to display and edit in the search field.
- `tokens`: A collection of tokens to display and edit in the search field.
- `suggestedTokens`: A collection of tokens to display as suggestions.
- `placement`: The preferred placement of the search field within the containing view hierarchy.
- `prompt`: A string representing the prompt of the search field which provides users with guidance on what to search for.
- `token`: A content builder that creates a view given an element in tokens.

## Mentioned in

Performing a search operation Suggesting search terms

## Discussion

Discussion For more information about using searchable modifiers, see Adding a search interface to your app.

## 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)
- [SearchSuggestionsPlacement](swiftui/searchsuggestionsplacement.md)
