From b7bc5ed8bc3a259963a87d75c60ff48c67a587f1 Mon Sep 17 00:00:00 2001 From: Shane Rosenthal Date: Wed, 15 Jul 2026 09:23:45 -0400 Subject: [PATCH] =?UTF-8?q?docs(mobile/4):=20alert=20button=20styles=20?= =?UTF-8?q?=E2=80=94=20cancel=20+=20destructive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documents the new styled-button shape for Dialog::alert(): ['label' => ..., 'style' => default|cancel|destructive], mixing freely with plain strings. Co-Authored-By: Claude Fable 5 --- .../views/docs/mobile/4/the-basics/dialogs.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/resources/views/docs/mobile/4/the-basics/dialogs.md b/resources/views/docs/mobile/4/the-basics/dialogs.md index ded552db..0952317b 100644 --- a/resources/views/docs/mobile/4/the-basics/dialogs.md +++ b/resources/views/docs/mobile/4/the-basics/dialogs.md @@ -26,6 +26,25 @@ Dialog::alert('Hello', 'Welcome to the app!'); Dialog::alert('Confirm', 'Are you sure?', ['Cancel', 'Delete']); ``` +### Button styles + +Any button can be an array with a `style` to get the platform's native treatment: + +```php +Dialog::alert('Delete post?', 'This cannot be undone.', [ + ['label' => 'Cancel', 'style' => 'cancel'], + ['label' => 'Delete', 'style' => 'destructive'], +]); +``` + +| Style | Behavior | +| --- | --- | +| `default` | Standard button (same as passing a plain string) | +| `cancel` | The dismissive action — bold and repositioned on iOS, placed in the conventional dismiss slot on Android | +| `destructive` | Rendered in the platform's destructive/error color (red) | + +Plain strings and styled arrays mix freely in the same alert. + `alert()` returns a `PendingAlert` you can configure fluently. If you don't call `->show()`, the alert displays automatically when the object goes out of scope.