Skip to content

useWindowSize ​

Category
Browser

Hook that manages a window size

typescript
import { useWindowSize } from '@elysiumorg/solid-use';

Usage ​

typescript
const size = useWindowSize();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
params.initialWidth?numberNumber.POSITIVE_INFINITYThe initial window width
params.initialHeight?numberNumber.POSITIVE_INFINITYThe initial window height