@polymer/polymer

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

Install

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

Overview

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

Index

Functions

Classes

Functions

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.

    Example:

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

    Returns

    Constructed HTMLTemplateElement

Classes

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.

Badge

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
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@polymer/polymer)
  • 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>