New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@open-wc/scoped-elements

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@open-wc/scoped-elements

Allows to auto define custom elements scoping them

  • 0.2.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
127K
decreased by-5.6%
Maintainers
2
Weekly downloads
 
Created

What is @open-wc/scoped-elements?

@open-wc/scoped-elements is an npm package that allows developers to use scoped custom elements in their web applications. This means that you can use the same custom element tag name multiple times in different parts of your application without conflicts. It is particularly useful in large applications or when integrating third-party components that might have naming conflicts.

What are @open-wc/scoped-elements's main functionalities?

Scoped Custom Elements

This feature allows you to define custom elements that are scoped to a particular component, preventing naming conflicts. In the code sample, `MyButton` is scoped to `MyElement`, allowing the use of `<my-button>` without worrying about conflicts with other components that might use the same tag name.

import { ScopedElementsMixin } from '@open-wc/scoped-elements';
import { LitElement, html } from 'lit';
import { MyButton } from './my-button.js';

class MyElement extends ScopedElementsMixin(LitElement) {
  static get scopedElements() {
    return {
      'my-button': MyButton,
    };
  }

  render() {
    return html`<my-button>Click me</my-button>`;
  }
}
customElements.define('my-element', MyElement);

Other packages similar to @open-wc/scoped-elements

Keywords

FAQs

Package last updated on 12 Feb 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc