---
title: "popover(isPresented:attachmentAnchor:arrowEdge:content:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/tabcontent/popover(ispresented:attachmentanchor:arrowedge:content:)"
---

# popover(isPresented:attachmentAnchor:arrowEdge:content:)

Presents a popover when a given condition is true.

## Declaration

```swift
nonisolated func popover<Content>(isPresented: Binding<Bool>, attachmentAnchor: PopoverAttachmentAnchor = .rect(.bounds), arrowEdge: Edge? = nil, @ContentBuilder content: @escaping () -> Content) -> some TabContent<Self.TabValue> where Content : View

```

## Parameters

- `isPresented`: A binding to a Boolean value that determines whether to present the popover content that you return from the modifier’s content closure.
- `attachmentAnchor`: The positioning anchor that defines the attachment point of the popover. The default is doc://com.apple.SwiftUI/documentation/SwiftUI/Anchor/Source/bounds.
- `arrowEdge`: The edge of the attachmentAnchor that defines the location of the popover’s arrow in macOS. The default is doc://com.apple.SwiftUI/documentation/SwiftUI/Edge/top.
- `content`: A closure returning the content of the popover.

## Discussion

Discussion Use this method to show a popover whose contents are a SwiftUI view that you provide when a bound Boolean variable is true. In the example below, a popover displays whenever the user toggles the isShowingPopover state variable by pressing the “Show Popover” button: struct PopoverExample: View {     @State private var isShowingPopover = false

var body: some View {         TabView {             Tab("Popover Anchor", systemImage: "arrow.down") {                 Button("Show Popover") {                     self.isShowingPopover = true                 }             }             .popover(isPresented: $isShowingPopover) {                 Text("Popover Content")                     .padding()             }         }     } }

## See Also

### Configuring tab content

- [badge(_:)](swiftui/tabcontent/badge(_:).md)
- [contextMenu(menuItems:)](swiftui/tabcontent/contextmenu(menuitems:).md)
- [customizationBehavior(_:for:)](swiftui/tabcontent/customizationbehavior(_:for:).md)
- [customizationID(_:)](swiftui/tabcontent/customizationid(_:).md)
- [defaultSectionExpansion(_:)](swiftui/tabcontent/defaultsectionexpansion(_:).md)
- [TabSectionExpansion](swiftui/tabsectionexpansion.md)
- [defaultVisibility(_:for:)](swiftui/tabcontent/defaultvisibility(_:for:).md)
- [disabled(_:)](swiftui/tabcontent/disabled(_:).md)
- [draggable(_:)](swiftui/tabcontent/draggable(_:).md)
- [dropDestination(for:action:)](swiftui/tabcontent/dropdestination(for:action:).md)
- [help(_:)](swiftui/tabcontent/help(_:).md)
- [hidden(_:)](swiftui/tabcontent/hidden(_:).md)
- [popover(item:attachmentAnchor:arrowEdge:content:)](swiftui/tabcontent/popover(item:attachmentanchor:arrowedge:content:).md)
- [sectionActions(content:)](swiftui/tabcontent/sectionactions(content:).md)
- [springLoadingBehavior(_:)](swiftui/tabcontent/springloadingbehavior(_:).md)
