Skip to content

This HTML to JSX library seamlessly transforms HTML strings into JSX syntax, enabling effortless integration of your content within JavaScript frameworks like React.

License

Notifications You must be signed in to change notification settings

DiogoAngelim/html-to-jsx

Repository files navigation

Overview

This HTML to JSX Library provides functions to manipulate and transform HTML strings in JavaScript. It has utilities to wrap HTML content, close self-closing tags, convert event attributes to camel case, convert class attributes to className, remove HTML comments, indent HTML code, convert inline styles to objects, and validate HTML structure.

Installation

To use the HTML Converter Library in your project, you can install it via npm:

npm install node-html-to-jsx

Usage

Import the library into your JavaScript file:

import convert from 'node-html-to-jsx';

Then, you can use the convert function to transform your HTML code:

const convertedHTML = convert('<div><p class="paragraph">Hello, world!</p></div>');

Demo

See DEMO

Note

This library is primarily designed for manipulating HTML strings in JavaScript environments, particularly for use with frameworks like React.

License

This library is open-source and available under the MIT License.

Contributions

Contributions to the library are welcome. You can contribute by forking the repository and submitting a pull request with your changes.

About

This HTML to JSX library seamlessly transforms HTML strings into JSX syntax, enabling effortless integration of your content within JavaScript frameworks like React.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published