Contents

sidebar

The search field appears in the sidebar of a navigation view.

Declaration

static var sidebar: SearchFieldPlacement { get }

Mentioned in

Discussion

The precise placement depends on the platform:

  • In iOS and iPadOS the search field appears in the section of the navigation bar associated with the sidebar.

  • In macOS the search field appears as a sticky header in the sidebar, attached to the toolbar.

If a sidebar isn’t available, like when you apply the searchable modifier to a view other than a navigation split view, SwiftUI uses automatic placement instead.

See Also

Getting a search field placement