# html-measure

> Make html to be measurable written by React

Latest version **0.5.1** (published 2018-09-24) · 0 weekly downloads

## Install

```sh
npm install html-measure
pnpm add html-measure
yarn add html-measure
bun add html-measure
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2018-09-24 |
| First published | 2018-09-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 39.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | moyuyc |

## Links

- npm: https://www.npmjs.com/package/html-measure
- npm.io page: https://npm.io/package/html-measure

## Dependencies (2)

- [prefix-classname](https://npm.io/package/prefix-classname.md) ^1.0.1
- [@rcp/util.createmount](https://npm.io/package/@rcp/util.createmount.md) ^1.0.9

## Recent versions

- 0.5.1 (latest) — 2018-09-24
- 0.4.1 — 2018-09-20
- 0.3.4 — 2018-09-18
- 0.3.3 — 2018-09-18
- 0.3.2 — 2018-09-18
- 0.3.0 — 2018-09-18
- 0.2.1 — 2018-09-17
- 0.2.0 — 2018-09-17
- 0.1.1 — 2018-09-17
- 0.1.0 — 2018-09-17

## README

# html-measure

[![NPM version](https://img.shields.io/npm/v/html-measure.svg?style=flat-square)](https://www.npmjs.com/package/html-measure)
[![NPM Downloads](https://img.shields.io/npm/dm/html-measure.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/html-measure)

> Make html to be measurable written by React

![](https://i.loli.net/2018/09/24/5ba8b09633089.png)

## Installation

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

## Usage

```javascript
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`

![](https://i.loli.net/2018/09/24/5ba8b1b604097.png)

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](mailto:moyuyc95@gmail.com).

## License

MIT

---
_Source: https://npm.io/package/html-measure · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
