Alerts

Explore various iOS Alert dialog configurations. Change button count, destructive actions, text fields, and more in the control panel to see changes reflected instantly on the iPhone screen.

9:41
●●●● WiFi 🔋
Alerts
Trigger Alert
Current Configuration
  • Button Count 2
  • Destructive Off
  • Text Field Off
  • Layout Side by Side
Common Patterns
Alert Title
This is an alert message that provides important information.
⚠️ HIG Violation: Improper alert usage
📚 HIG Guidelines — Try It Yourself
✓ Do — Good Example
✗ Don't — Bad Example

✓ Do This

  • Use alerts only for important information that requires acknowledgment
  • Keep alert titles short and descriptive
  • Use a two-button alert for decisions
  • Place the preferred action on the trailing side (right)
  • Use destructive style for actions that delete or remove data
  • Use Cancel to let people abandon the action

✗ Don't Do This

  • Don't use alerts for non-essential information
  • Don't overuse alerts — they interrupt the user's flow
  • Don't use an alert when an action sheet is more appropriate
  • Don't include more than 3 buttons in a single alert
  • Don't use vague titles like "Error" or "Warning"
  • Don't use "Yes" / "No" — use descriptive verb labels

👆 See the bad pattern in the iPhone preview above

Default
Error
Delete
Save
Has Destructive Button
Has Text Field
SwiftUI Code