{"repo":"maslianok/react-resize-detector","free":true,"listed":false,"github":"https://github.com/maslianok/react-resize-detector","clone":"git clone https://github.com/maslianok/react-resize-detector.git","description":"A Cross-Browser, Event-based, Element Resize Detection for React","language":"TypeScript","stars":1302,"topics":["react","resize","cross-browser","resize-events","resizeobserver","react-resize-observer","resizer","resizeable","resizes"],"license":"MIT","category":"deployment-docker-iac","readme_excerpt":"Handle element resizes like it's 2025! Live demo Modern browsers now have native support for detecting element size changes through ResizeObservers. This library utilizes ResizeObservers to facilitate managing element size changes in React applications. 🐥 Tiny 2kb 🐼 Written in TypeScript 🐠 Used by 170k repositories 🦄 Produces 100 million downloads annually No window.resize listeners! No timeouts! Should you use this library? Consider CSS Container Queries first! They now work in all major browsers and might solve your use case with pure CSS. CSS Container Queries Example Use this library when you need: - JavaScript-based resize logic with full TypeScript support - Complex calculations based on dimensions - Integration with React state/effects - Programmatic control over resize behavior Installation Quick Start Basic Usage With Resize Callback With External Ref (Advanced) It's not advised to use this approach, as dynamically mounting and unmounting the observed element could lead to unexpected behavior. API Reference Hook Signature Props Prop Type Description Default ----------------- ------------------------------------------- --------------------------------------------------------------------------------------------------------------------- ----------- onResize (payload: ResizePayload) = void Callback invoked with resize information undefined handleWidth boolean Trigger updates on width changes true handleHeight boolean Trigger updates on height changes true skipOnMount","default_branch":null,"files":null,"tree":[],"storefront":"/r/maslianok","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/maslianok/react-resize-detector/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}