singui

0.3.7 • Public • Published

SINGUI

The next-gen, no compile/transpile needed, self-contained JS UI library

Try it out

Usage

Browser

<script src="https://cdn.jsdelivr.net/npm/singui/dist/main.min.js"></script>
<script>
	const {browser, tags, text, attr, prop, setGlobalCtx} = singui
</script>

or

import {browser, tags, text, attr, prop, setGlobalCtx} from 'singui'

or

const {browser, tags, text, attr, prop, setGlobalCtx} = require('singui')

then

setGlobalCtx(browser())

const app = (target) => build(({attach}) => {
	const {h1, center, p} = tags

	center(() => {
		h1(() => {
			attr.style = 'font-weight: 300'
			text('Hello World!')
		})
	})

	p(() => {
		const style = prop.style
		style.color = 'green'
		style.textAlign = 'center'
		text('Welcome to SingUI')
	})

	attach(target)
})

app(document.body)

More details please see Try it out

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i singui

Weekly Downloads

3

Version

0.3.7

License

MIT

Unpacked Size

335 kB

Total Files

16

Last publish

Collaborators

  • classicoldsong