https://github.com/shoonia/jsx-dom-runtime
A tiny 500-byte library for JSX syntax templates targeting the DOM. Supports HTML, SVG, and MathML tags
https://github.com/shoonia/jsx-dom-runtime
babel-plugin jsx jsx-dom jsx-syntax jsx-templates
Last synced: 18 days ago
JSON representation
A tiny 500-byte library for JSX syntax templates targeting the DOM. Supports HTML, SVG, and MathML tags
- Host: GitHub
- URL: https://github.com/shoonia/jsx-dom-runtime
- Owner: shoonia
- License: mit
- Created: 2021-03-06T10:03:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-05-30T15:14:55.000Z (about 1 month ago)
- Last Synced: 2025-05-30T19:18:42.797Z (about 1 month ago)
- Topics: babel-plugin, jsx, jsx-dom, jsx-syntax, jsx-templates
- Language: TypeScript
- Homepage: https://shoonia.github.io/jsx-dom-runtime/
- Size: 5.77 MB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.
[](https://www.npmjs.com/package/jsx-dom-runtime)
[](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)