<Modal>
Component
<Modal>
overlays a dialog to the entire site's page or entire specified section.
You need to place <YourComponent>
inside the <Modal>
in order to make an interactive UI.
<Modal>
handles esc key to close itself. Once closed, the <Modal>
restores the focus to the previously focused element.
<Modal>
also handles tab key to switch focus only for the focusable elements inside <YourComponent>
.
Here the demo: