V2.0.0

HTMLCreator

  • this version improve the creation of any element, the HTMLCreator is a method that construct a HTMLElement.
import { HTMLCreator } from '@rebelstack-io/metaflux'
HTMLCreator('div', {
	id: 'container',
	content: 'Hello World'
})

this will create

<div id="container">
	hello world
</div>

In adition we create a buch of pre-made functions

import { Div } from '@rebelstack-io/metaflux'
Div({id: 'container'}, 'hello world')

this will create the same html as above

With the new custom componenents we added chaining child creation

// NOTE: Chaining always will return the last element in this case the button
const child = Div().Div({className: 'wrapper'}).Button(false, 'Clickme');
// if we need our base element
const base = child.baseNode()
// this will return the first div in the chain

this will create

<div>
	<div class="wrapper">
		<button>Clickme</button>
	</div>
</div>

complete helper elements list

  • H1
  • H2
  • H3
  • H4
  • H5
  • H6
  • Div
  • Span
  • Ol
  • Ul
  • Li
  • Table
  • Thead
  • Tbody
  • Tfoot
  • Tr
  • Td
  • Th
  • Form
  • Label
  • Input
  • TextArea
  • Button
  • Img
  • Picture
  • Source
  • Select
  • Option
  • P
  • A
  • Section
  • Video