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

# tabViewSearchActivation(_:)

Configures the activation and deactivation behavior of search in the search tab.

## Declaration

```swift
nonisolated func tabViewSearchActivation(_ activation: TabSearchActivation) -> some View

```

## Discussion

Discussion Use this modifier on a TabView to change how search activation is handled. The exact activation behavior is determined by the TabSearchActivation you pass to this modifier: struct TabExampleView: View {     @State private var text: String = ""

var body: some View {         TabView {             Tab("Books", systemImage: "book") {                 BooksTab()             }             Tab(role: .search) {                 NavigationStack {                     SearchContent()                 }             }         }         .searchable(text: $text)         .tabViewSearchActivation(.searchTabSelection)     } } By default, search is only activated and deactivated by the user.

## See Also

### Tab views

- [defaultAdaptableTabBarPlacement(_:)](swiftui/view/defaultadaptabletabbarplacement(_:).md)
- [defaultTabBarPlacement(_:)](swiftui/view/defaulttabbarplacement(_:).md)
- [sectionActions(content:)](swiftui/view/sectionactions(content:).md)
- [tabBarMinimizeBehavior(_:)](swiftui/view/tabbarminimizebehavior(_:).md)
- [tabViewBottomAccessory(content:)](swiftui/view/tabviewbottomaccessory(content:).md)
- [tabViewBottomAccessory(isEnabled:content:)](swiftui/view/tabviewbottomaccessory(isenabled:content:).md)
- [tabViewCustomization(_:)](swiftui/view/tabviewcustomization(_:).md)
- [tabViewSidebarHeader(content:)](swiftui/view/tabviewsidebarheader(content:).md)
- [tabViewSidebarFooter(content:)](swiftui/view/tabviewsidebarfooter(content:).md)
- [tabViewSidebarBottomBar(content:)](swiftui/view/tabviewsidebarbottombar(content:).md)
