
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@ajnauleau/custom-components
Advanced tools
Make and style custom web components easily!
$ npm install --save @ajnauleau/custom-components
First start out by adding css styles to your component:
import { Component } from '@ajnauleau/custom-components';
const Custom = Component.styled`
color: red;
background: black;
`;
Extend your component by adding any valid HTML between template literals ``:
class WebComponent extends Custom {
constructor() {
super();
}
render() {
let world = 'world';
return (
`<div>
<p>hello ${world}</p>
<div>
`
)
}
}
Render your new web component and give it a custom name. REMEMBER! Web component names must use a hyphen (-).
customElements.define('custom-component', WebComponent);
Embed and link your javascript, then use your new custom component.
<html>
<body>
<custom-component>
</custom-component>
<script type="module" src="./index.js"></script>
</body>
</html>
Here's the complete javascript file for your reference.
import Component from '@ajnauleau/custom-components';
const Custom = Component.styled`
color: red;
background: black;
`;
class WebComponent extends Custom {
constructor() {
super();
}
render() {
return (
`<p>hello</p>`
)
}
}
customElements.define('custom-component', WebComponent);
Attribute to Props, similar to React
constructor()
render()
componentDidMount()
componentDidUpdate()
componentWillUnmount()
FAQs
'Simple Custom Web Components for your Project'
We found that @ajnauleau/custom-components 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.