Dialog with React Router
Using React Router to create a modal Dialog that's controlled by the browser history.
Components
DialogOpen a new window that can be either modal or non-modal and optionally rendered in a React portal. This component is based on the WAI-ARIA Dialog Pattern.
ButtonTrigger an action or event, such as submitting a Form, opening a Dialog, canceling an action, or performing a delete operation in React. This component is based on the WAI-ARIA Button Pattern.
FocusablePress Tab or click to shift focus to any React element. This abstract component standardizes focus behavior across different browsers.
VisuallyHiddenHide an element visually but keep it available for screen readers and other assistive technologies.
Controlling the Dialog state
To control the open state, you can pass the open
and onClose
props to the Dialog
component. These props allow you to synchronize the dialog state with other state sources, such as the browser history.