Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shoonia/jsx-dom-runtime

A tiny in 500 bytes library to JSX syntax templates for DOM. Support HTML, SVG and MathML tags
https://github.com/shoonia/jsx-dom-runtime

babel-plugin jsx jsx-dom jsx-syntax jsx-templates

Last synced: 5 days ago
JSON representation

A tiny in 500 bytes library to JSX syntax templates for DOM. Support HTML, SVG and MathML tags

Awesome Lists containing this project

README

        

# jsx-dom-runtime

A tiny in 500 bytes library to [JSX](https://facebook.github.io/jsx/) syntax templates for [DOM](https://dom.spec.whatwg.org/). Support [HTML](https://html.spec.whatwg.org/multipage/), [SVG](https://www.w3.org/TR/SVG/) and [MathML](https://www.w3.org/TR/MathML3/) tags.

[![npm version](https://badgen.net/npm/v/jsx-dom-runtime)](https://www.npmjs.com/package/jsx-dom-runtime)
[![Stand with Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua/)

## Install

```bash
npm i jsx-dom-runtime
# or
yarn add jsx-dom-runtime
```

## How to use

Add preset to your [`.babelrc`](https://babeljs.io/docs/en/config-files) file.

**.babelrc**

```json
{
"presets": [
"jsx-dom-runtime/babel-preset"
]
}
```

## Example

```js
// add to the end of the head
document.head.append(

);

// add to the end the the body
document.body.append(

Hello World!



);
```

[Demo](https://github.com/shoonia/jsx-dom-runtime/tree/master/DEMO)

## Documentation

- [Get Started](https://github.com/shoonia/jsx-dom-runtime/wiki#jsx-dom-runtime)
- [Syntax](https://github.com/shoonia/jsx-dom-runtime/wiki#syntax)
- [APIs](https://github.com/shoonia/jsx-dom-runtime/wiki#apis)
- [TypeScript Support](https://github.com/shoonia/jsx-dom-runtime/wiki#typescript-support)

## License

[MIT](https://github.com/shoonia/jsx-dom-runtime/blob/master/LICENSE)