Socket
Book a DemoInstallSign in
Socket

@netflix/x-element

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netflix/x-element

A dead simple basis for custom elements.

latest
Source
npmnpm
Version
2.0.0-rc.13
Version published
Maintainers
0
Created
Source
  x-element
  _________
 / /__ __\ \
/ / \ \ / \ \
\ \ /_\_\ / /
 \_\_____/_/

A dead simple basis for custom elements. It provides the following functionality:

  • Efficient DOM generation and data binding using your preferred templating engine
  • Automatic .property to [attribute] reflection (opt-in)
  • Automatic [attribute] to .property synchronization (one-directional, on connected)
  • Simple and efficient property observation and computation
  • Simple delegated event handling
  • Useful error messages

See SPEC.md for all the deets.

Installation:

Save a local copy to your project:

curl https://raw.githubusercontent.com/Netflix/x-element/main/x-element.js > x-element.js
curl https://raw.githubusercontent.com/Netflix/x-element/main/x-parser.js > x-parser.js
curl https://raw.githubusercontent.com/Netflix/x-element/main/x-template.js > x-template.js

Then import it:

import XElement from '/path/to/x-element.js';

...or load it directly from the web:

import XElement from 'https://deno.land/x/element/x-element.js';

...or use an importmap:

<script type="importmap">
  {
    "imports": {
      "@netflix/x-element": "https://deno.land/x/element/x-element.js"
    }
  }
</script>

Then import it using a bare module specifier...

import XElement from '@netflix/x-element';

...or use a package manager:

npm install @netflix/x-element

Then import it using a bare module specifier...

import XElement from '@netflix/x-element';

Project Philosophy:

  • No compilation step is necessary for adoption, just import x-element.js
  • Implement a minimal set of generalized functionality
  • Make as few design decisions as possible
  • Presume adopters are browser experts already (stay out of their way)
  • Follow web platform precedents whenever possible
  • Remain compatible with any browser which fully supports custom elements
  • Prioritize simple syntax and useful comments in the code itself
  • Avoid making developers learn new proprietary stuff
  • Zero dependencies

Development:

npm install && npm start

Then...

FAQs

Package last updated on 06 Aug 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.