use-element-fit
Advanced tools
+7
-2
| { | ||
| "name": "use-element-fit", | ||
| "version": "0.3.0", | ||
| "description": "use-element-fit", | ||
| "version": "0.4.0", | ||
| "description": "useElementFit is a React hook that allows you to measure and element's based on certain restraints, similar to object-fit in CSS.", | ||
| "keywords": [ | ||
| "resize-observer", | ||
| "object-fit", | ||
| "background-size" | ||
| ], | ||
| "main": "dist/index.js", | ||
@@ -6,0 +11,0 @@ "types": "dist/index.d.ts", |
+4
-1
@@ -7,4 +7,7 @@ [](https://travis-ci.com/art0rz/use-element-fit) | ||
| # Motivation | ||
| Working with canvas or more complex uses of `object-fit` often makes it useful to calculate the width/height and x/y values of a element or object, this effect helps you do this. | ||
| # Usage | ||
| See `useElementFit` in [action](https://art0rz.github.io/use-element-fit/) | ||
| ```js | ||
@@ -11,0 +14,0 @@ import React from 'react'; |
202370
0.23%36
9.09%