coderef

Imperative slot assignmentBaseline · Widely available

The assign() method for <slot> elements assigns nodes to the slot, as an alternative to using the slot and name HTML attributes. The nodes must be children of a shadow host and the shadow root must be created with the slotAssignment set to "manual". Also known as manual slot assignment.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 27, 2023. Widely available since Sep 27, 2025.

Browser support

DesktopChrome
1–91Not supported
92+Supportedsince Jul 20, 2021
Current: 155
Edge
12–91Not supported
92+Supportedsince Jul 22, 2021
Current: 154
Firefox
1–91Not supported
92+Supportedsince Sep 7, 2021
Current: 157
Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27
MobileChrome Android
18–91Not supported
92+Supportedsince Jul 20, 2021
Current: 155
Firefox Android
4–91Not supported
92+Supportedsince Sep 7, 2021
Current: 157
Safari iOS
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: assign.

Feature detection

JS · check before using
if ("HTMLSlotElement" in globalThis && "assign" in HTMLSlotElement.prototype) {
  // HTMLSlotElement.assign is available
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLSlotElement.assign92929216.4929216.4
ShadowRoot.slotAssignment86869216.4869216.4