Type-safe document.createElement wrapper with JSX support and optional reactive library integrations for building DOM elements.
| Package | Description |
|---|---|
@lilian1315/create-element |
Core library — type-safe element creation, JSX runtime, and reactive adapters |
@lilian1315/elements-writable-properties-types |
Auto-generated TypeScript types for writable DOM element properties |
pnpm add @lilian1315/create-elementimport { h } from '@lilian1315/create-element'
const app = h('div', { class: 'container' }, [
h('h1', null, 'Hello World!'),
h('button', { onclick: () => alert('Clicked!') }, 'Click me'),
])
document.body.appendChild(app)- Type-safe — full TypeScript support with autocompletion for element attributes
- HTML, SVG, and MathML — create any DOM element with namespace-aware prefixes (
svg:circle,math:mi) - JSX — use JSX syntax via standard
react-jsxtransform - Reactive adapters — optional first-class integrations with popular signal libraries:
See the full API documentation and usage guide.
pnpm install
pnpm -r build
pnpm -r testMIT