coderef

<slot>Baseline · Widely available

The &#x3C;slot> HTML element is a placeholder inside a web component where consumers of the component can insert their own markup.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–52Not supported
53+Supportedsince Aug 31, 2016
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–62Not supported
63+Supportedsince Oct 23, 2018
Current: 157
Safari
1–9.1Not supported
10+Supportedsince Sep 20, 2016
Current: 27
MobileChrome Android
18–52Not supported
53+Supportedsince Sep 7, 2016
Current: 155
Firefox Android
4–62Not supported
63+Supportedsince Oct 23, 2018
Current: 157
Safari iOS
1–9.3Not supported
10+Supportedsince Sep 13, 2016
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: assignedSlot.

Feature detection

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

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Element.assignedSlot53796310536310
Element.slot53796310536310
HTMLSlotElement53796310536310
HTMLSlotElement.assignedElements65796612.1656612.2
HTMLSlotElement.assignedNodes53796310536310
HTMLSlotElement.name53796310536310
HTMLSlotElement.slotchange_event53796310.1536310.3
Text.assignedSlot53796310536310
slotted50796310506310
slot53796310536310
slot.name53796310536310
slot53796310536310