• Version 3.5.1
  • Published
  • 1.31 MB
  • 1 dependency
  • BSD-3-Clause license


npm i @polymer/polymer
yarn add @polymer/polymer
pnpm add @polymer/polymer


The Polymer library makes it easy to create your own web components. Give your element some markup and properties, and then use it on a site. Polymer provides features like dynamic templates and data binding to reduce the amount of boilerplate you need to





function html

html: (strings: TemplateStringsArray, ...values: any[]) => HTMLTemplateElement;
  • A template literal tag that creates an HTML element from the contents of the string.

    This allows you to write a Polymer Template in JavaScript.

    Templates can be composed by interpolating HTMLTemplateElements in expressions in the JavaScript template literal. The nested template's innerHTML is included in the containing template. The only other values allowed in expressions are those returned from htmlLiteral which ensures only literal values from JS source ever reach the HTML, to guard against XSS risks.

    All other values are disallowed in expressions to help prevent XSS attacks; however, htmlLiteral can be used to compose static string values into templates. This is useful to compose strings into places that do not accept html, like the css text of a style element.


    static get template() { return html` :host{ content:"..." } ${this.partialTemplate} ${super.template} `; } static get partialTemplate() { return html<span>Partial!</span>; }


    Constructed HTMLTemplateElement


class PolymerElement

class PolymerElement extends ElementMixin(HTMLElement) {}
  • Base class that provides the core API for Polymer's meta-programming features including template stamping, data-binding, attribute deserialization, and property change observation.

Package Files (2)

Dependencies (1)

Dev Dependencies (26)

Peer Dependencies (0)

No peer dependencies.


To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@polymer/polymer.

  • Markdown
  • HTML
    <a href="https://www.jsdocs.io/package/@polymer/polymer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>