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: 155Edge
12–91Not supported
92+Supportedsince Jul 22, 2021
Current: 154Firefox
1–91Not supported
92+Supportedsince Sep 7, 2021
Current: 157Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27MobileChrome Android
18–91Not supported
92+Supportedsince Jul 20, 2021
Current: 155Firefox Android
4–91Not supported
92+Supportedsince Sep 7, 2021
Current: 157Safari iOS
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27How 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
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLSlotElement.assign | 92 | 92 | 92 | 16.4 | 92 | 92 | 16.4 |
| ShadowRoot.slotAssignment | 86 | 86 | 92 | 16.4 | 86 | 92 | 16.4 |