---
title: "Dialog Icon | Explore SwiftUI"
description: "Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms"
canonical_url: "https://exploreswiftui.com/library/view/dialog-icon"
meta:
  author: "Explore SwiftUI"
  "og:description": "Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Dialog%2BIcon%2Cdescription_~Q29uZmlndXJlcyB0aGUgaWNvbiB1c2VkIGJ5IGRpYWxvZ3Mgd2l0aGluIHRoaXMgdmlldy4gT24gbWFjT1MsIHRoaXMgaWNvbiByZXBsYWNlcyB0aGUgZGVmYXVsdCBpY29uIG9mIHRoZSBhcHAuIE9uIHdhdGNoT1MsIHRoaXMgaWNvbiB3aWxsIGJlIHNob3duIGluIGFueSBkaWFsb2dzIHByZXNlbnRlZC4gVGhpcyBtb2RpZmllciBoYXMgbm8gZWZmZWN0IG9uIG90aGVyIHBsYXRmb3Jtcy4%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjc5L3ZhcmlhbnRzLzMzNDI~dj0xNzk2MzcwMTE5NjA0JnI9MiZ3PTY0MCZoPTQ4MCZmPXBuZw%2CimageMode_fit%2CimagePosition_center%2CimageFrame_~ZmlsdGVyOiBkcm9wLXNoYWRvdygwIDAgMXB4IHJnYmEoMCwwLDAsMC4wNikpIGRyb3Atc2hhZG93KDAgLTEwcHggMjVweCByZ2JhKDM3LDk5LDIzNSwwLjE4KSk7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyJdfQ%2Cp_Ii9saWJyYXJ5L3ZpZXcvZGlhbG9nLWljb24i%2Cs_Qyv9AtCjSGbisgMR.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Dialog Icon | Explore SwiftUI"
  "twitter:description": "Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Dialog%2BIcon%2Cdescription_~Q29uZmlndXJlcyB0aGUgaWNvbiB1c2VkIGJ5IGRpYWxvZ3Mgd2l0aGluIHRoaXMgdmlldy4gT24gbWFjT1MsIHRoaXMgaWNvbiByZXBsYWNlcyB0aGUgZGVmYXVsdCBpY29uIG9mIHRoZSBhcHAuIE9uIHdhdGNoT1MsIHRoaXMgaWNvbiB3aWxsIGJlIHNob3duIGluIGFueSBkaWFsb2dzIHByZXNlbnRlZC4gVGhpcyBtb2RpZmllciBoYXMgbm8gZWZmZWN0IG9uIG90aGVyIHBsYXRmb3Jtcy4%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjc5L3ZhcmlhbnRzLzMzNDI~dj0xNzk2MzcwMTE5NjA0JnI9MiZ3PTY0MCZoPTQ4MCZmPXBuZw%2CimageMode_fit%2CimagePosition_center%2CimageFrame_~ZmlsdGVyOiBkcm9wLXNoYWRvdygwIDAgMXB4IHJnYmEoMCwwLDAsMC4wNikpIGRyb3Atc2hhZG93KDAgLTEwcHggMjVweCByZ2JhKDM3LDk5LDIzNSwwLjE4KSk7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyJdfQ%2Cp_Ii9saWJyYXJ5L3ZpZXcvZGlhbG9nLWljb24i%2Cs_Qyv9AtCjSGbisgMR.png"
  "twitter:title": "Dialog Icon | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[iPhone Duo](https://exploreswiftui.com/duo?element=279) [iPhone](https://exploreswiftui.com/iphone?element=279) [iPad](https://exploreswiftui.com/ipad?element=279) [Apple Watch](https://exploreswiftui.com/watch?element=279) [Apple TV](https://exploreswiftui.com/tv?element=279)

# **Dialog Icon**

Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms.

![Dialog Icon - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/279/variants/3322?v=1796370119530&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 17.0+ iPadOS 17.0+ macOS 13.0+ watchOS 10.0+ tvOS 17.0+

### **Tags**

[**modifier**](https://exploreswiftui.com/?search=modifier "Search for modifier (opens in a new tab)") [**dialogIcon**](https://exploreswiftui.com/?search=dialogIcon "Search for dialogIcon (opens in a new tab)")

### **SwiftUI Code**

[Docs](<https://developer.apple.com/documentation/swiftui/view/dialogicon(_:)>)

```
@State var isShowingDialog = false

var body: some View {
    Button("FooBar") {
        isShowingDialog = true
    }
    .confirmationDialog(
        "Are you sure you want to do FooBar?",
        isPresented: $isShowingDialog
    ) {
        Button("Foo", role: .destructive, action: action)
        Button("Bar", role: .cancel) {
            isShowingDialog = false
        }
    }
    .dialogIcon(Image(.cats))

}
```

### **Found an issue or have a suggestion?**

Created: December 4, 2026Updated: December 4, 2026

### **More View Components **

[**View all **](https://exploreswiftui.com/library/view)

![Text Tightening - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/275/variants/3308?v=1796318332299&r=2&w=412&q=75&f=webp)

### **Text Tightening**

Sets whether text in this view can compress the space between characters when necessary to fit text in a line.

![Symbol Rendering Mode - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/277/variants/3314?v=1796314720618&r=2&w=412&q=75&f=webp)

### **Symbol Rendering Mode**

Sets the rendering mode for symbol images within this view.

![Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/262/variants/2227?v=1794899667529&r=2&w=412&q=75&f=webp)

### **Scroll Gesture Axis Lock**

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

![VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/260/variants/2143?v=1793707679045&r=2&w=412&q=75&f=webp)

### **VisionOS background materials**

All background materials on visionOS

![Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/257/variants/1987?v=1792070676534&r=2&w=412&q=75&f=webp)

### **Container Content Margins**

Adds the margins of the container the view is in.

![Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/254/variants/1863?v=1790589836833&r=2&w=412&q=75&f=webp)

### **Toolbar Vertical Edge**

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

![Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2&w=412&q=75&f=webp)

### **Hinge State**

A type encapsulating the state of a single hinge.

![Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/246/variants/1636?v=1790277107518&r=2&w=412&q=75&f=webp)

### **Disabled Toolbar Vertical Behavior**

Disables the vertical bar.

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![AccessoryLinearCapacityGaugeStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/45/variants/257?v=1790073478842&r=2&w=412&q=75&f=webp)

### **AccessoryLinearCapacityGaugeStyle**

A gauge style that displays bar that fills from leading to trailing edges as the gauge’s current value increases

![Refreshable List - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/126/variants/359?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Refreshable List**

Marks this view as refreshable.

![PasteButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/35/variants/235?v=1790073478842&r=2&w=412&q=75&f=webp)

### **PasteButton**

A system button that reads items from the pasteboard and delivers it to a closure.

![Outline Group - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/132/variants/371?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Outline Group**

A structure that computes views and disclosure groups on demand from an underlying collection of tree-structured, identified data.

![TabsPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/233/variants/182?v=1790073478842&r=2&w=412&q=75&f=webp)

### **TabsPickerStyle**

A picker style that presents options as segmented tabs. On macOS, this style produces a segmented picker with a visual treatment that distinguishes tab navigation from value selection. On iOS, tvOS, and visionOS, the visual appearance matches that of the standard standard .segmented style. On all supported platforms, VoiceOver announces options as tabs.

![Sheet Background - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/139/variants/426?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Sheet Background**

Sets the presentation background of the enclosing sheet using a shape style.

![Default Adaptable Tab Bar Placement - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/170/variants/673?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Default Adaptable Tab Bar Placement**

Specifies the default placement for the tabs in a tab view using the adaptable sidebar style.

![Glass Button Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/87/variants/314?v=1794863768271&r=2&w=412&q=75&f=webp)

### **Glass Button Styles**

A button style that applies glass border artwork based on the button’s context

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/dialog-icon#webpage","@type":"WebPage","dateModified":"2026-12-04T07:41:59.620Z","datePublished":"2026-12-04T13:41:00.000Z","description":"Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms","name":"Dialog Icon","url":"https://exploreswiftui.com/library/view/dialog-icon","breadcrumb":{"@id":"https://exploreswiftui.com/library/view/dialog-icon#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/view/dialog-icon#article"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/view/dialog-icon"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/view/dialog-icon#article","citation":"https://developer.apple.com/documentation/swiftui/view/dialogicon(_:)","dateModified":"2026-12-04T07:41:59.620Z","datePublished":"2026-12-04T13:41:00.000Z","description":"Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms","headline":"Dialog Icon","inLanguage":"en-US","name":"Dialog Icon","thumbnailUrl":"https://exploreswiftui.com/api/images/279/variants/3342?v=1796370119604&r=2","url":"https://exploreswiftui.com/library/view/dialog-icon","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"hasPart":{"@id":"https://exploreswiftui.com/library/view/dialog-icon#source-code"},"image":{"@id":"https://exploreswiftui.com/library/view/dialog-icon#/schema/image/1"},"isPartOf":{"@id":"https://exploreswiftui.com/library/view/dialog-icon#webpage"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/view/dialog-icon#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/dialog-icon#source-code","@type":"SoftwareSourceCode","codeSampleType":"full example","description":"Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms","name":"Dialog Icon SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"@State var isShowingDialog = false\n\nvar body: some View {\n    Button(\"FooBar\") {\n        isShowingDialog = true\n    }\n    .confirmationDialog(\n        \"Are you sure you want to do FooBar?\",\n        isPresented: $isShowingDialog\n    ) {\n        Button(\"Foo\", role: .destructive, action: action)\n        Button(\"Bar\", role: .cancel) {\n            isShowingDialog = false\n        }\n    }\n    .dialogIcon(Image(.cats))\n\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"View"},{"@type":"Thing","name":"Dialog Icon"}]},{"@id":"https://exploreswiftui.com/library/view/dialog-icon#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"View","item":"https://exploreswiftui.com/library/view","position":2},{"@type":"ListItem","name":"Dialog Icon","item":"https://exploreswiftui.com/library/view/dialog-icon","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/library/view/dialog-icon#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/279/variants/3342?v=1796370119604&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/279/variants/3342?v=1796370119604&r=2"}]}
```