1.1.0 • Published 4 years ago

hyperapp-tags v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

hyperapp-tags

To write HTML code in HyperApp v2.x using regular HTML tags. This lib does same jobs as @hyperapp/html but get updated with HyperApp v2.x and later.

NPM Build Status Coverage Status

Usage

// install if not yet
npm install hyperapp-tags

Then import it to use:

const hyperTag = require('hyperapp-tags');

// or newer syntax
// import hyperTag from 'hyperapp-tags';

const {div, ul, li, a} = hyperTag;

div(
  {
    id: 'leftPanel',
    class: 'container sidebar',
  },
  [
    ul(
      {},
      [
        li(
          {
            class: 'menu-item',
          },
          [
            a(
              {
                class: 'link',
                href: '/home',
              },
              'Home',
            ),
          ]
        ),
        li(
          {
            class: 'menu-item',
          },
          [
            a(
              {
                class: 'link',
                href: '/about',
              },
              'About',
            ),
          ]
        ),
        li(
          {
            class: 'menu-item',
          },
          [
            a(
              {
                class: 'link',
                href: '/contact',
              },
              'Contact',
            ),
          ]
        ),
      ]
    ),
  ]
);

Test

git clone https://github.com/ndaidong/hyperapp-tags.git
cd hyperapp-tags
npm install
npm test

License

The MIT License (MIT)

1.1.0

4 years ago

1.0.0

4 years ago

0.0.1

5 years ago