# useWindowSize
Tracks the current dimensions of the browser window and updates on resize.
This hook is useful for building responsive components and layouts.
## Usage
```tsx
import { useWindowSize } from '@gilbarbara/hooks';
function Component() {
const { width } = useWindowSize();
return
{width >= 1024 ? 'Large Screen' : 'Small Screen'}
;
}
```
**Triggering Animations on Resize**
```tsx
import { useWindowSize } from '@gilbarbara/hooks';
function Component() {
const { width } = useWindowSize(100);
return (
768 ? 'lightblue' : 'lightcoral' }}>
Resize the window to see the background color change!
);
}
```
## Reference
```typescript
interface UseWindowSizeResult {
height: number;
width: number;
}
useWindowSize(debounce?: number): UseWindowSizeResult;
```