npm.io
0.5.1 • Published 8 years ago

html-measure

Licence
—
Version
0.5.1
Deps
2
Size
40 kB
Vulns
0
Weekly
0

html-measure

NPM version NPM Downloads

Make html to be measurable written by React

Installation

npm install html-measure
# or use yarn
yarn add html-measure

Usage

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