github vanjs-org/van 1.5.3
1.5.3: Support specifying `options` of `document.createElement` in tag functions

latest release: 1.5.5
8 months ago

This release adds the support of specifying options of document.createElement or document.createElementNS in props argument of tag functions.

Below is an example of using this feature to create a custom button element:

const {button} = van.tags

class MyButton extends HTMLButtonElement {
  connectedCallback() {
    this.addEventListener("click", () => alert("MyButton clicked!"))
  }
}
customElements.define("my-button", MyButton, {extends: "button"})

const CustomButton = () => button({is: "my-button"}, "Click me")

van.add(document.body, CustomButton())

See the release announcement: #290 (comment)

Don't miss a new van release

NewReleases is sending notifications on new releases.