Skip to content

About

A tiny 500-byte library for JSX syntax templates targeting the DOM. Supports HTML, SVG, and MathML tags

Topics

Resources

Stars

15 stars

Watchers

1 watching

Forks

Repository files navigation

jsx-dom-runtime

A tiny 500-byte library for JSX syntax templates targeting the DOM. Supports HTML, SVG, MathML and Custom Element tags.

npm version Stand with Ukraine

Install

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

How to use

Add preset to your .babelrc file.

.babelrc

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

Example

import { render } from 'jsx-dom-runtime';

render(
  <main class="box">
    <h1 class="title">Hello World!</h1>
  </main>,
  document.getElementById('root')
);

Demo

Documentation

Getting Started

Syntax & Features

API Reference

  • signal() - Reactive values that update attributes, properties, and text automatically
  • useRef() - Create DOM element references
  • Callback Refs - Reference elements with callbacks
  • useText() - Create reactive Text nodes

Tooling

License

MIT

About

A tiny 500-byte library for JSX syntax templates targeting the DOM. Supports HTML, SVG, and MathML tags

Topics

Resources

Stars

15 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages