Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

CustomElements

Addy Osmani edited this page Aug 19, 2013 · 1 revision

The Custom Elements specification is the normative description of this part of Web Components.

Custom elements are new types of DOM elements that can be defined by authors. Unlike decorators, which are stateless and ephemeral, custom elements can encapsulate state and provide script interfaces. The following table summarizes the key differences between decorators and custom elements.

The <element> element defines a custom element. It specifies the type of element it's a refinement of using the extends attribute:

<element extends="button" name="fancy-button">
    …
</element>

The extends attribute specifies the tag name of the kind of element this element is an extension of. Instances of the custom element will have the tag name specified here.

The name attribute specifies the name of the custom element, by which it will be referred to in markup. These names must include a hyphen.

Clone this wiki locally