useScrollBlockingOverlay

The

useScrollBlockOverlay
hook is used to toggle a component's visibility while blocking scrolling as it's visible.

Note: This hook is located in the ´@carla/flora-next` package and only works in applications using Next.js.

Params

All params are passed as an object.

Name
Type
Default
Description
defaultVisible
bool
false
The default visibility on initial render
maxWidth
int
The maximum width at which the overlay is visible. Automatically hides on resize

Returns

Array
: An array containing the
visible
state and the
setVisible
setter. It returns the same signature as
React.useState
does.

Examples

Nested modals

Using maxWidth