Unfortunately, dialogs are something a significant number of sites fail at accessibility-wise, and it'd be great if this component could bake in accessibility best practices. In particular:
Dialogs need aria-describedby so they're automatically read. A good heuristic might be automatically setting aria-describedby to the ID of the first child element with text. That would probably catch most cases where a dialog has a paragraph of text content. For others, perhaps a "describedby" attribute would allow specifying a section by ID.
Focus needs to be brought into the dialog. Without this, screen reader users need to find and manually interact with the dialog.
Additionally, aria-hidden needs to be set to true on all non-dialog content. Without this, screen reader focus still seems to remain within the page regardless of whether browser focus was brought into the dialog. aria-hidden must then be restored to its original value when the dialog is dismissed.
Unfortunately, dialogs are something a significant number of sites fail at accessibility-wise, and it'd be great if this component could bake in accessibility best practices. In particular: