useWindowSize
Track window dimensions reactively. SSR-safe — returns 0 during server rendering.
import { useWindowSize } from "@allem-sdk/hooks";Returns
| Property | Type | Description |
|---|---|---|
| width | number | Window inner width |
| height | number | Window inner height |
Usage
const { width, height } = useWindowSize();
<p>Window: {width} x {height}</p>
{width < 768 && <MobileLayout />}