Skip to content

lilian1315/create-element

Repository files navigation

@lilian1315/create-element

npm jsr License: MIT

Type-safe document.createElement wrapper with JSX support and optional reactive library integrations for building DOM elements.

Packages

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

Quick Start

pnpm add @lilian1315/create-element
import { 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)

Features

  • 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-jsx transform
  • Reactive adapters — optional first-class integrations with popular signal libraries:

Documentation

See the full API documentation and usage guide.

Development

pnpm install
pnpm -r build
pnpm -r test

License

MIT

About

Type-safe `document.createElement` wrapper with JSX support and optional reactive lib integrations for building DOM elements.

Topics

Resources

Stars

Watchers

Forks

Contributors