useModal
Hides content outside the current <OverlayContainer>
from screen readers
on mount and restores it on unmount. Typically used by modal dialogs and
other types of overlays to ensure that only the top-most modal is
accessible at once.
install | yarn add @react-aria/overlays |
---|---|
version | 3.7.3 |
usage | import {useModal} from '@react-aria/overlays' |
API#
useModal(
(options: ModalOptions
)): ModalAria
Example#
See useDialog and useOverlayTrigger for examples of using
useModal
to hide external elements from screen readers.