lithen-super-element
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.1 • Public • Published

    Lithen - Super Element

    Lithen is a set of simple tools, that anyone could have built, to use with Web Components. They can be used alone, so it's provided separately.

    Super Element is a class used to create Web Components, it provides some features to make Web Components usage a bit simple. But it not focus on change the aproach of using the Web Components, like implementing reactivity and the like, its a bit like a syntax sugar.

    This package uses ESModules.

    Usage

    import { SuperElement } from 'lithen-super-element'
    
    class AppElement extends SuperElement {
      constructor() {
        super()
    
        this.applyRender()
        this.init()
      }
    
      init() {
        this.select('p').className = 'text'
      }
      
      styling() {
        return `
          .text {
            color: #d45;
          }
        `
      }
    
      render() {
        return '<p>Element using Lithen</p>'
      }
    }
    
    customElements.define('app-element', AppElement)

    SuperElement methods and attributes

    Other libs that are part of Lithen

    Install

    npm i lithen-super-element

    DownloadsWeekly Downloads

    5

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    32.3 kB

    Total Files

    59

    Last publish

    Collaborators

    • gabriel.jose