
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
WebComponent base class for building custom HTML elements.
const ZComponent = require('zcomponent')
class MyElement extends ZComonent {
set customProperty (value) {
console.log(value)
}
}
window.customElements.define('my-element', MyElement)
document.body.innerHTML += `<my-element customProperty="test"></my-element>`
Any attributes set on the element that correspond to property setters you have on your class will be set as regular properties (thereby calling your setter) on the element.
Element attributes that do not correspond to your setters will be ignored.
ZComponent includes two features related to the shadow DOM. First, it allows you to set the initial shadow DOM by adding a getter for the shadow property.
const ZComponent = require('zcomponent')
class MyElement extends ZComonent {
get shadow () {
return `
<style>
:host {
margin: 0 0 0 0;
padding: 0 0 0 0;
}
</style>
<slot></slot>
`
}
}
Second, if you ever set the shadow property of your element it will replace the current shadow dom.
const ZComponent = require('zcomponent')
class MyElement extends ZComonent {
set myCustomShadowCSS (cssString) {
this.shadow = `<style>${cssString}</style><slot></slot>`
}
}
window.customElements.define('my-element', MyElement)
document.body.innerHTML += `<my-element></my-element>`
document.querySelector('my-element').myCustomShadowCSS = `
:host {
margin: 0 0 0 0;
padding: 0 0 0 0;
}
`
If you never use these features your element will not have a shadow DOM attached.
FAQs
WebComponent base class for building custom HTML elements.
We found that zcomponent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.