useHasOverflow

Detects whether an element has horizontal or vertical overflow.

Detects whether an element has content that overflows its bounds, both horizontally and vertically. Optionally observes DOM mutations to keep overflow state up to date.

Import#

import { useHasOverflow } from '@volue/wave-react';

Example#


API Reference#

Arguments#

Prop
Type
Default
observeMutations
boolean
false
mutationOptions
MutationObserverInit
{ childList: true }

Returns#

[setElement: (el: T | null) => void, hasHorizontalOverflow: boolean, hasVerticalOverflow: boolean] — A tuple with a ref callback and two booleans indicating overflow state.