Socket
Book a DemoInstallSign in
Socket

html-traits

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-traits

Built-in web components for all elements.

0.0.3
latest
npmnpm
Version published
Weekly downloads
4
Maintainers
0
Weekly downloads
 
Created
Source

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?

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

Examples

Example are here.

Keywords

html

FAQs

Package last updated on 29 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.