# react-html-markup

> React Js HTML Parser

Latest version **1.0.8** (published 2021-11-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-html-markup
pnpm add react-html-markup
yarn add react-html-markup
bun add react-html-markup
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-11-20 |
| First published | 2018-10-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Monty Khanna |
| Maintainers | montykhanna |
| Keywords | React JS, HTML, Typescript, Parser, Markup |

## Links

- npm: https://www.npmjs.com/package/react-html-markup
- Repository: https://github.com/mackraja/react-markup
- Homepage: https://github.com/mackraja/react-markup#readme
- Issues: https://github.com/mackraja/react-markup/issues
- npm.io page: https://npm.io/package/react-html-markup

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2021-11-20
- 1.0.7 — 2021-11-20
- 1.0.6 — 2018-10-23
- 1.0.5 — 2018-10-18
- 1.0.4 — 2018-10-17
- 1.0.3 — 2018-10-17
- 1.0.2 — 2018-10-17
- 1.0.1 — 2018-10-17
- 1.0.0 — 2018-10-17

## README

# react-html-markup

[[react-html-markup]](https://nodei.co/npm/react-html-markup/)

An HTML to React parser that works on the server and the browser:

It converts an HTML string to [React elements](https://facebook.github.io/react/docs/react-api.html#creating-react-elements).

## Example

```js

In React JS (Hooks)
--------------------

import React from 'react';
import Markup from 'react-html-markup';

const Foo = () {
  const dbString = '<p>Hello from <b>React HTML Markup</b></p>';
  return (
    <Markup
      htmlString={ dbString } // html string that is coming from database or static html string.
      htmlTag='div' // You can add any html tag
      ... // You can add multiple attributes here like (class, data-title, style), that will apply on htmlTag you defined (div)
    />
  );
}
export default Foo;


Output show in Browser:
-----------------------
<div><p>Hello from <b>React HTML Markup</b></p></div>
```

## Installation

[NPM](https://www.npmjs.com/package/html-react-parser):
```sh
$ npm install react-html-markup --save
```

[Yarn](https://yarn.fyi/html-react-parser):
```sh
$ yarn add react-html-markup
```

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