Skip to content

useWindowSize

Tracks the current window size.

Usage

import { useWindowSize } from "@/hooks/browser/use-window-size";
const Component = () => {
const { width, height } = useWindowSize();
return (
<div>
<p>Window Width: {width}</p>
<p>Window Height: {height}</p>
</div>
);
};

Installation

Terminal window
npx atmx add hook use-window-size