A tiny 500-byte library for JSX syntax templates targeting the DOM. Supports HTML, SVG, MathML and Custom Element tags.
npm i jsx-dom-runtime
# or
yarn add jsx-dom-runtimeAdd preset to your .babelrc file.
.babelrc
{
"presets": [
"jsx-dom-runtime/babel-preset"
]
}import { render } from 'jsx-dom-runtime';
render(
<main class="box">
<h1 class="title">Hello World!</h1>
</main>,
document.getElementById('root')
);- Attributes
- SVG
- Style
- Event Handling
- Attribute Directives (
attr:*) - Property Directives (
prop:*) - Function Components
- Fragments
- 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
- ESLint Support - Linting rules and configuration
- TypeScript Support - Type definitions and setup