# Alert95

A modal Swift95 alert presented from any SwiftUI view.

The alert95 modifier renders a themed modal while preserving native Button roles, enabled state, keyboard shortcuts, and dismissal semantics.

![Swift95 alert with actions](/images/alert95-macos.png)

The open alert produced after activating the button in the snippet below.

## Use it

```swift
import Swift95
import SwiftUI

struct Alert95Example: View {
  @State private var isPresented = false

  var body: some View {
    Button95("Replace file") {
      isPresented = true
    }
    .alert95(
      "Replace file?",
      isPresented: $isPresented,
      isCloseButtonEnabled: false,
      icon: {
        Image(systemName: "exclamationmark.triangle.fill")
          .font(.system(size: 40))
      },
      actions: {
        Button("Replace", role: .destructive) {}
        Button("Cancel", role: .cancel) {}
      },
      message: {
        Text("A file with this name already exists.")
      }
    )
  }
}
```

## Essential behavior

**Actions**Supply native SwiftUI Button values; Swift95 renders their labels and roles.

**Dismissal**Actions and the enabled close control set isPresented to false.

**Platform**Uses an app modal on compact platforms and a child panel on macOS.

## Related

- [Button95](/components/button/)
- [WorkspaceWindowActions95](/components/workspace-window-actions/)
- [Strings95](/components/strings/)

[Open the complete Alert95 API reference →](/api/documentation/swift95/button95/alert95\(_:ispresented:isclosebuttonenabled:actions:message:\)-5m4dn)
