::slotted

A pseudo-element used inside a Web Component (Shadow DOM) to style elements that have been 'slotted' into a <slot> tag from the light DOM.

Quick example

/* Inside the shadow DOM of a custom element */
::slotted(img) {
  /* Styles images that were passed into the component's slot */
  border-radius: 50%;
  max-width: 100px;
}

::slotted Browser Support

Widely available Since 2020 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

Safe to use without fallbacks.

50+
63+
10+
79+
ESC