<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.0.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "tvOS: 13.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 6.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Alert/init(title:message:dismissButton:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5AlertV5title7message13dismissButtonAcA4TextV_AHSgAC0G0VSgtcfc"
  },
  "title" : "init(title:message:dismissButton:)"
}
-->

# init(title:message:dismissButton:)

Creates an alert with one button.

```
init(title: Text, message: Text? = nil, dismissButton: Alert.Button? = nil)
```

## Parameters

`title`

The title of the alert.

`message`

The message to display in the body of the alert.

`dismissButton`

The button that dismisses the alert.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)