Skip to content

[docs] Document the difference(s) between Dialog and AlertDialog #1687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
benface opened this issue Apr 8, 2025 · 0 comments
Open

[docs] Document the difference(s) between Dialog and AlertDialog #1687

benface opened this issue Apr 8, 2025 · 0 comments
Labels
docs Improvements or additions to the documentation

Comments

@benface
Copy link

benface commented Apr 8, 2025

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 use AlertDialog. 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 has dismissible and modal props while AlertDialog.Root doesn't (why? I guess because alert dialogs are always modal and never dismissible, but perhaps that should be said) and that AlertDialog doesn't seem to have the same support for nested dialogs (or maybe the documentation of that feature is just less complete on the AlertDialog page?).

If the only difference is the default value of (Alert)Dialog.Popup's role attribute and the absence of some props in AlertDialog 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's Dialog and accept a role prop which, when set to alertdialog, would set Dialog.Root's dismissible prop to false and override Dialog.Popup's role? It feels cleaner than conditionally rendering Dialog or AlertDialog parts everywhere.

Thank you!

@benface benface added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 8, 2025
@mj12albert mj12albert added docs Improvements or additions to the documentation and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 9, 2025
@mj12albert mj12albert changed the title [Dialog] [AlertDialog] Document the difference(s) between Dialog and AlertDialog [docs] Document the difference(s) between Dialog and AlertDialog Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants