0.5.1 • Published 7 years ago
html-measure v0.5.1
html-measure
Make html to be measurable written by React

Installation
npm install html-measure
# or use yarn
yarn add html-measureUsage
import HtmlMeasure from 'html-measure'
import 'html-measure/style.css'
// or
import 'html-measure/style.less'
ReactDOM.render(<HtmlMeasure html="<div>foo</div>" />, window.root)Props
className
- Type:
string
style
- Type:
object
html
- Type:
string
unit
- Type: one of
'px' | 'rem' - Default:
'px'
remStandardPx
- Type:
number - Default:
16
scaleGapPx

The size of the read rect in the above picture.
- Type:
number - Default:
10
isShowUnit
- Type:
boolean - Default:
true
isCalcContainerWidth
- Type:
boolean - Default:
true
numberFixed
- Type:
number - Default:
0
Authors
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
License
MIT