4.1.5 • Published 5 years ago

belit v4.1.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

belit

Fork of a simple library for composable DOM elements using tagged template strings.

belit is a library for translating template strings into DOM elements on the server and on the client.

Example

belit can be used with other libraries (like hyperx) to create DOM trees.

const belit = require('belit')
const hyperx = require('hyperx')

const html = hyperx(belit(), {comments: true})
const div = html`
  <div>
    <h1>This is in a DOM tree</h1>
  </div>
`

Namespaces

You can pass in a namespace to properly create namespaced elements (like svg)

const belit = require('belit')
const hyperx = require('hyperx')

const svg = hyperx(belit('http://www.w3.org/2000/svg'), {comments: true})
const div = svg`
  <svg height="200" width="200">
    <rect width="100" height="100" />
  </svg>
`

You can use the belit.html and belit.svg instead of calling the top-level function

const belit = require('belit')
const hyperx = require('hyperx')

const svg = hyperx(belit.svg, {comments: true})
const div = svg`
  <svg height="200" width="200">
    <rect width="100" height="100" />
  </svg>
`

original license

(c) 2016 Kyle Robinson Young. MIT License

4.1.5

5 years ago

4.1.4

5 years ago

4.1.3

5 years ago

4.1.2

6 years ago

4.1.1

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.0.0

6 years ago