Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyperapp-html

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperapp-html

Html helpers for hyperapp `h`

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

hyperapp-html

npm Slack

Html helpers for hyperapp h.

Note

This library is builded using meta programing through template engine to allow the use of tree shaking and a better optimisation.

Installation

Using npm:

npm i hyperapp-html

Then setup a build pipeline and import it.

import { div, h1 } from "hyperapp-html"

Using a CDN:

<script src="https://unpkg.com/hyperapp-html"></script>

Then access the all hmtl tags from hyperappHtml in the global scope as hyperappHtml.div, hyperappHtml.h1, etc...

Usage

const vnode = h1({ id: "title" }, "Hi.")

Example

Try it online

app({
  state: {
    count: 0
  },
  view: (state, actions) =>
    main([
      h1({}, state.count),
      button({
        onclick: actions.down,
        disabled: state.count <= 0
      }, "ー"),
      button({
        onclick: actions.up
      }, "+")
    ]),
  actions: {
    down: state => ({ count: state.count - 1 }),
    up: state => ({ count: state.count + 1 })
  }
})

API

Tags

tagname

Type: (props: object, children: vnode[]) => vnode

Call h to return a vnode according to the tag name.

const vnode = tagname({ id: "title" }, "Hi.")

License

hyperapp-html is MIT licensed. See LICENSE.

Keywords

FAQs

Package last updated on 28 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc