Skip to main content

2 docs tagged with "shadow-dom"

View all tags

The slot Element

Learn the slot element: how a component built with shadow DOM leaves named places for a page author's own content. Covers default and named slots, fallback content, which nodes get assigned where, styling slotted content with ::slotted, the slotchange event, accessibility across the shadow boundary, and security notes. Includes a live slot lab and a which-slot matcher.

Web Components in HTML

Learn web components from the HTML side: build your own tags with custom elements, keep markup and styles private with shadow DOM, reuse templates and slots, send events across the shadow boundary, and enhance progressively. Covers naming, lifecycle callbacks, attributes and properties, ::part and custom properties, accessibility, security, and when to choose something else. Includes a live custom element lab and a which-technology matcher.