---
title: "searchPresentationToolbarBehavior(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/searchpresentationtoolbarbehavior(_:)"
---

# searchPresentationToolbarBehavior(_:)

Configures the search toolbar presentation behavior for any searchable modifiers within this view.

## Declaration

```swift
nonisolated func searchPresentationToolbarBehavior(_ behavior: SearchPresentationToolbarBehavior) -> some View

```

## Discussion

Discussion By default on iOS, a toolbar may hide parts of its content when presenting search to focus on searching. You can override this behavior by providing a value of avoidHidingContent to this modifer. @State private var searchText = ""

List {     // ... content } .searchable(text: $searchText) .searchPresentationToolbarBehavior(.avoidHidingContent)

## See Also

### Displaying toolbar content during search

- [SearchPresentationToolbarBehavior](swiftui/searchpresentationtoolbarbehavior.md)
