← Back to release summary

Imperative Shadow DOM Distribution API

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 86)
Intent stage
Shipped

WPT details: Fully tested in WPT. https://wpt.fyi/results/shadow-dom/slots-imperative-slot-api.tentative.html?label=master&label=experimental&aligned https://wpt.fyi/results/shadow-dom/slots-imperative-api-slotchange.tentative.html?label=master&label=experimental&aligned

Summary

Web developers can specify node-to-slot assignments imperatively in Shadow DOM slotting. Please see the spec discussion [1] and the explainer [2]. - [1] https://github.com/whatwg/html/issues/3534 - [2] https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Imperative-Shadow-DOM-Distribution-API.md

Motivation

Allow node-to-slot assignments without needing to add slot attribute in markup. And enabled dynamic slotting behavior based on input conditions.

Standards & signals

Ecosystem

Docs: https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Imperative-Shadow-DOM-Distribution-API.md

Explainers: https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Imperative-Shadow-DOM-Distribution-API.md

View on chromestatus.com