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 |
---|---|
version | 3.20.0 |
usage | import {useModal} from 'react-aria' |
API#
useModal(
(options?: AriaModalOptions
)): ModalAria
Example#
See useDialog and useOverlayTrigger for examples of using
useModal
to hide external elements from screen readers.