Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/klzns/declarative-dom

Mini experimental library to declarative build UIs
https://github.com/klzns/declarative-dom

Last synced: 26 days ago
JSON representation

Mini experimental library to declarative build UIs

Awesome Lists containing this project

README

        

# Declarative DOM

> Is mini experimental library to declarative build UIs

## How

```js
import d from 'declarative-dom'

function MyComponent({ text }) {
const handleClick = () => { console.log(text) }

return d(
'div', { id: 'my-component', onClick: handleClick },
Message({ text })
)
}

function Message({ text }) {
return d(
'span', { style: 'color: red;' },
text
)
}

document.body.appendChild(MyComponent({ text: 'Hello World!' }))
```