JSPM

html-traits

0.0.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 6
    • Score
      100M100P100Q20607F
    • License ISC

    Built-in web components for all elements.

    Package Exports

    • html-traits
    • html-traits/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (html-traits) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    html-traits

    Warning: This is alpha software and is highly experimental. Although it is meant to mimic built-in web components the API might change and not all the API may be implemented.

    This library is meant to be similar to built-in web components which uses the is attribute. This uses the traits HTML attribute and can handle multiple traits to one element. It also can be used with any element as it doesn't inherit the specific element but the element is passed into the class' constructor.

    What are the advantages over web components?

    1. Composition over inheritance.
    2. Multiple traits to one element.
    3. Ordered traits.
    4. Built for progressive enhancement.
    5. No need for extra elements on your page just to get new runtime behavior.
    6. Cleaner HTML.

    Examples

    Example are here.