react-resize-to-aspect-ratio
v1.0.7
Published
A react component that tracks if an element has changed size (a react wrapper for element-resize-event). Also it can resizes height/width to match aspect ratio
Downloads
17
Readme
react-resize-to-aspect-ratio
A react component that triggers an event when an element changes size. It also can automatically keep a given aspect ratio when the element resizes.
This react component is based on element-resize-event
Example Use:
npm i react-resize-to-aspect-ratio -S
import Resize from 'react-resize-to-aspect-ratio';
<Resize aspectRatio="16:9">
<div style={{ width: '100%' }}>
Hello World
</div>
</Resize>