sw-ui-alert
sw-ui-alert
Modal confirmation / alert dialog primitive built on the native
<dialog> element. Resolves a Promise with the user’s choice when used
via the companion showPrompt() helper.
Two interaction modes are selectable through the reflected type attribute:
confirm(default) — renders both Cancel and OK buttons; the returned Promise resolves totrueon accept andfalseon reject / dialog close.alert— renders only OK; the Promise resolves totrueonce acknowledged or the dialog is dismissed.
The dialog uses the platform <dialog> element so focus management,
ESC-to-dismiss, and ::backdrop styling all come for free.
Class: SwUiAlert · Module: packages/web-components/src/components/UI/sw-ui-alert.ts
class: SwUiAlert, sw-ui-alert
Fields
title
title field.
description
description field.
type
type field.