[docs] Document the difference(s) between Dialog
and AlertDialog
#1687
Labels
docs
Improvements or additions to the documentation
Docs feedback
How can we improve Base UI documentation?
As I implement my own styled modal dialog component with Base UI, I am wondering when to use
Dialog
and when to useAlertDialog
. I've read the MDN pages for the dialog and alertdialog roles, but I feel like the Base UI docs should have a section about the actual differences in behavior, as implemented in Base UI. Otherwise, the user is left comparing both pages and noticing that, for example,Dialog.Root
hasdismissible
andmodal
props whileAlertDialog.Root
doesn't (why? I guess because alert dialogs are always modal and never dismissible, but perhaps that should be said) and thatAlertDialog
doesn't seem to have the same support for nested dialogs (or maybe the documentation of that feature is just less complete on theAlertDialog
page?).If the only difference is the default value of
(Alert)Dialog.Popup
'srole
attribute and the absence of some props inAlertDialog
because it doesn't support dismissibility or non-modality for accessibility reasons, I wonder if it's acceptable, for my reusable styled dialog component, to always use Base UI'sDialog
and accept arole
prop which, when set toalertdialog
, would setDialog.Root
'sdismissible
prop tofalse
and overrideDialog.Popup
'srole
? It feels cleaner than conditionally renderingDialog
orAlertDialog
parts everywhere.Thank you!
The text was updated successfully, but these errors were encountered: