---
title: "searchable(text:editableTokens:isPresented:placement:prompt:token:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/searchable(text:editabletokens:ispresented:placement:prompt:token:)-2ilmg"
---

# searchable(text:editableTokens:isPresented:placement:prompt:token:)

Marks this view as searchable, which configures the display of a search field.

## Declaration

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

```

## Parameters

- `text`: The text to display and edit in the search field.
- `editableTokens`: A collection of tokens to display and edit in the search field.
- `isPresented`: A doc://com.apple.SwiftUI/documentation/SwiftUI/Binding which 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.
