HTML · Links and media
slot
A placeholder inside a web component where the parent supplies content.
Syntax
<slot name="…"></slot>Example
Try it
Notes
Slots only work inside a shadow root. The custom element must be defined with customElements.define.
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.