[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/API/Web_components [Back]  [Original]

- - API | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

-

Invalid slug for templ/sidebar: -

- - , , - -.

In this article

, , - . - HTML ( ), UI, , .

- - , , , .

  • : API- JavaScript, , .
  • Shadow DOM: API- JavaScript DOM , DOM , . , , , .
  • HTML templates: <template> <slot> , . .

- :

  1. , -, ECMAScript 2015 ( . ).
  2. CustomElementRegistry.define(), , , , , , , .
  3. DOM Element.attachShadow(). , .. DOM, DOM.
  4. HTML template, <template> <slot>. DOM, DOM.
  5. , , , HTML.

, , -, .

shadow DOM

, DOM, , DOM , DOM, .

, , HTML <template> <slot>, -.

CustomElementRegistry

, , CustomElementRegistry.define(), , .

Window.customElements

CustomElementRegistry.

-, , :

  • connectedCallback: , DOM .
  • disconnectedCallback: , DOM .
  • adoptedCallback: , .
  • attributeChangedCallback: , .

CSS

, :

CSS

, :

Shadow DOM

ShadowRoot

DOM.

DocumentOrShadowRoot

, , .

Element

Element, DOM:

Node

Node, DOM:

Event

Event, DOM:

HTML templates

<template>

HTML, , JavaScript, . DOM - HTMLTemplateElement.

<slot>

-, , DOM . DOM - HTMLSlotElement.

HTML slot

DOM.

Slotable

, Element, Text, , <slot>. , Slotable.assignedSlot, , .

Element extensions

Element, :

CSS

, :

slotchange

HTMLSlotElement ( <slot>) (-), .

GitHub -. .

Specification
HTML
# the-template-element
DOM
# interface-shadowroot

html.elements.template

api.ShadowRoot


Web Proxy Viewer  |  New URL  |  Original Page