Skip to content

Document using HTML dialog element #4647

@o-t-w

Description

@o-t-w

Modals/Dialogs are very common on the web. Now that the HTML dialog element has full cross-browser support it would be great to see documentation around how to use this in React as it is far from obvious. In the current docs it says "instead of exposing open() and close() methods on a Dialog component, pass an isOpen prop to it." Should people avoid using the showModal() function? Is it necessary to use portals when using a HTML dialog element?

Such a common UI task should be clearly documented.

<dialog> used to have some accessibility concerns but all of those have been addressed. It's now a much better option than implementing your own dialog. It has many accessibility features like 'inert' built-in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions