Dialog
Modal dialog with title, description, and action buttons.
s0 add dialog
Usage
@State private var showDialog = false
S0.Dialog(isPresented: $showDialog, title: "Confirm Deletion") {
S0.Button("Delete", variant: .destructive, action: { })
S0.Button("Cancel", variant: .outline, action: { showDialog = false })
}Button("Show Dialog") { showDialog = true }
.s0Dialog(isPresented: $showDialog, title: "Are you sure?", description: "This action cannot be undone.") {
S0.Button("Confirm", action: { })
}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| isPresented | Binding<Bool> | — | Controls dialog visibility. |
| title | String | — | Dialog title text. |
| description | String? | nil | Optional description text below the title. |