lit-custom-element
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Coverage Status Build Status npm version License: MIT

lit-custom-element

Lightweight library for building native web components

Installation

  npm install lit-custom-element
  import { LitCustomElement, html } from 'lit-custom-element'
 
  class HelloWorld extends LitCustomElement {
 
    get message() {
      return this._message
    }
 
    set message(value) {
      this._message = value
      this.onPropertyChanged('message', true)
    }
 
    static get styles() {
      return `
        h1 { 
          color: red;
        }
      `
    }
 
    render() {
      return html `<h1>Hello ${this.message}!</h1>`
    }
 
  }
 
  customElements.define('hello-world', HelloWorld)

Package Sidebar

Install

npm i lit-custom-element

Weekly Downloads

2

Version

0.0.6

License

ISC

Unpacked Size

154 kB

Total Files

15

Last publish

Collaborators

  • aelbore