Create an HTML element with full declarative configuration.
Combines element creation with class, style, attribute, children, and event binding in a single call — reducing imperative boilerplate.
Optional
const card = create('div', { text: 'Hello', css: { padding: '1rem', '--theme': 'dark' }, attrs: { 'data-id': '123' }, class: ['card', 'active'], children: [create('span', { text: 'child' }), 'text node'], on: { click: handler }, signal: controller.signal }); Copy
const card = create('div', { text: 'Hello', css: { padding: '1rem', '--theme': 'dark' }, attrs: { 'data-id': '123' }, class: ['card', 'active'], children: [create('span', { text: 'child' }), 'text node'], on: { click: handler }, signal: controller.signal });
Create an HTML element with full declarative configuration.
Combines element creation with class, style, attribute, children, and event binding in a single call — reducing imperative boilerplate.