-
-
Notifications
You must be signed in to change notification settings - Fork 0
Styling
B.Cem edited this page Jul 28, 2026
·
1 revision
dialogStyle works like SwiftUI's buttonStyle: apply it to the content inside the peekDialog closure.
.peekDialog(isPresented: $showDialog) {
Text("Hello")
.padding()
.dialogStyle(.glassRegular) // ✅ inside
}Applying it outside the closure has no effect — see Common Mistakes.
| Style | Notes |
|---|---|
| (default) | Material background, rounded rectangle — used when you omit .dialogStyle
|
.plain |
No background; you style the content yourself |
.glassRegular |
Glass effect (iOS 26+) |
.glassClear |
Clear glass (iOS 26+) |
.peekDialog(isPresented: $showDialog) {
Text("Glass")
.padding()
.dialogStyle(.glassRegular)
}.plain keeps the max-width frame but strips the default material background so you own the look:
.peekDialog(isPresented: $showToast, dismissDelay: .short) {
Text("Copied to clipboard")
.foregroundColor(.white)
.padding(.horizontal, 20)
.padding(.vertical, 12)
.background {
RoundedRectangle(cornerRadius: 20)
.fill(Color.black.opacity(0.8))
}
.dialogStyle(.plain)
}Need something reusable across the app? → Custom Styles