Skip to content

useModalSurface

useModalSurface(): boolean

Defined in: packages/react/src/hooks/useModalSurface.tsx:32

Whether the calling component is rendered inside a modal surface.

A popover inside a dialog must be modal itself so it joins that dialog’s focus trap; the same popover on a normal page must not be, because modal popovers lock page scroll.

boolean

true inside a Modal, otherwise false.