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

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

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

## Declaration

```swift
nonisolated func searchable<C, T, S>(text: Binding<String>, tokens: Binding<C>, suggestedTokens: Binding<C>, isPresented: Binding<Bool>, 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.
- `isPresented`: A doc://com.apple.SwiftUI/documentation/SwiftUI/Binding that controls the presented state of search.
- `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.

## Discussion

Discussion For more information about using searchable modifiers, see Adding a search interface to your app. For information about presenting a search field programmatically, see Managing search interface activation.

## See Also

### Detecting, activating, and dismissing search

- [Managing search interface activation](swiftui/managing-search-interface-activation.md)
- [isSearching](swiftui/environmentvalues/issearching.md)
- [dismissSearch](swiftui/environmentvalues/dismisssearch.md)
- [DismissSearchAction](swiftui/dismisssearchaction.md)
- [searchable(text:isPresented:placement:prompt:)](swiftui/view/searchable(text:ispresented:placement:prompt:).md)
- [searchable(text:tokens:isPresented:placement:prompt:token:)](swiftui/view/searchable(text:tokens:ispresented:placement:prompt:token:).md)
- [searchable(text:editableTokens:isPresented:placement:prompt:token:)](swiftui/view/searchable(text:editabletokens:ispresented:placement:prompt:token:).md)
