reactjs / reactjs/react.dev

Document using HTML dialog element

Open
#4,647 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No documentation file or test is named. Start by reviewing the current React documentation guidance quoted in the issue, then investigate how the HTML dialog element, showModal(), and portals should be used together. Done means the React docs clearly explain the recommended approach and answer whether showModal() and portals are necessary.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript, react
Domain
documentation, frontend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.