Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Custom Elements Manifest (CEM) is a JSON format that describes a package’s custom-element APIs so development tools can find and explain them. Generate the usual custom-elements.json file with the analyzer, then make it discoverable to package consumers by declaring its path in package.json.

What is a Custom Elements Manifest?

A Custom Elements Manifest is machine-readable metadata about custom elements and their APIs. It gives IDEs, documentation viewers, linters and design tools a shared way to discover components and present information about them. The project describes CEM as “A file format for describing custom elements” (project README).

The commonly used output filename is custom-elements.json. The manifest describes component declarations and their relationships; it is not executable component code, a runtime loader or a replacement for the JavaScript that implements the elements.

How do you generate custom-elements.json?

The official analyzer reads source files and collects information from their abstract syntax trees before producing a manifest (analyzer README).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Install the analyzer as a development dependency: npm i -D @custom-elements-manifest/analyzer.

  2. From the package directory, run custom-elements-manifest analyze. The shorter command is cem analyze.

  3. Review the generated custom-elements.json and configure the analyzer for your package. Its documented controls include source globs and exclusions, output directory, dependency manifests, updating package.json, and watch mode.

    Rank #2
    Sale
    HTML and CSS: Design and Build Websites
    • HTML CSS Design and Build Web Sites
    • Comes with secure packaging
    • It can be a gift option
  4. If the source uses a supported framework-specific pattern, configure the analyzer’s handling for LitElement, FASTElement, Stencil or Catalyst, as applicable.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generated metadata depends on what the analyzer can derive from source and its configuration. Review the resulting file as part of your documentation or release workflow rather than assuming that every detail of runtime behavior can be inferred from static analysis.

How do tools discover the manifest in an npm package?

A package can advertise the manifest location in its package.json using the customElements field. This gives tools a published pointer to the metadata, so they can locate it without downloading and inspecting the package tarball (project README).

That field is package metadata, not a loader: it tells compatible tools where the description is, but does not register or execute any custom elements. Consumers still need the package’s actual component implementation for runtime use.

What does the schema describe?

The schema’s CustomElementDeclaration extends class metadata with fields for the custom-element API. Optional information includes the tag name, superclass reference, attributes, events, slots, CSS parts, CSS properties, CSS states, source reference, summary and description. A custom-element-definition export records a tag name and points to the declaration that implements it (schema and project documentation).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Those structured details let downstream tools build API tables, property and attribute editors, event references, documentation pages, design-tool integrations and validation hints from the same package metadata. They describe the declared API; they do not guarantee or fully specify every behavior a component exhibits when running.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

What version is the schema?

The official repository lists schema version 2.1.0, dated 2024-05-06, in its schema-version table (repository schema-version table). Schema versioning can differ from the npm package version, so treat these as separate version numbers rather than assuming the analyzer package version identifies the manifest schema.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When is CEM useful—and what does it not do?

For a component package, CEM is most valuable when the metadata is generated or maintained alongside the source and the package points to the published file. That makes one API description available to multiple tools without confusing documentation metadata with the implementation itself.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.