virtual-sidebar
Nested sidebar for virtual-dom. Takes an array and turns it into nested HTML.
Features
- sensible: creates text nodes by default which are ideal to get started
- flexible: easily extensible to create more complicated elements
- small: minimal code size providing minimal overhead
- reliable: transforms data into nodes without any internal state
Usage
const vsidebar = const vdom = const hyperx = const hx = const data = 'main-section' 'sub-section-1' 'item-1' 'item-2' 'footer-section' const tree = hx` <section> </section>`console
yields
main-section sub-section-1 item-1 item-2 footer-section
API
virtualSidebar(h, opts?, data)
Create a new sidebar based on an array of data.
- opts.map(h, name): use a map function that takes raw node data and returns an element. Useful to create more intricate nodes
Installation
$ npm install virtual-sidebar