On this page
<slot>
Prev: `<template>` | Up: interactive | Next: `<link>`
Rel: interactive, Interactive & Scripting Guide
Ref: MDN Web Docs — <slot>
Tags: #public #web #html #elements #interactive #tier/specialized
Summary
Insertion placeholder inside a Shadow DOM tree for projecting light-DOM children.
- Implicit ARIA Role:
none - DOM Interface:
HTMLSlotElement - Key Attributes:
name
Notes & Best Practices
- Shadow DOM content projection: Unnamed
<slot>catches default children;<slot name="header">matches<h2 slot="header">.
Example
<template id="card-tpl">
<article>
<header><slot name="title">Untitled</slot></header>
<slot></slot>
</article>
</template>
Linked from
Related notes
- tuts/html/elements/interactive/link Linked here; links to this page; shared tags: #elements, #html, #interactive, #tier, #web
- tuts/html/elements/interactive/template Linked here; links to this page; shared tags: #elements, #html, #interactive, #tier, #web
- tuts/html/elements/interactive Linked here; links to this page; shared tags: #elements, #html, #interactive, #web
- tuts/html/elements/interactive_and_scripting Linked here; shared tags: #elements, #html, #interactive, #web
- tuts/html/elements/interactive/details shared tags: #elements, #html, #interactive, #tier, #web
- tuts/html/elements/interactive/dialog shared tags: #elements, #html, #interactive, #tier, #web
- tuts/html/elements/interactive/iframe shared tags: #elements, #html, #interactive, #tier, #web
- tuts/html/elements/forms/button shared tags: #elements, #html, #tier, #web
- tuts/html/elements/forms/datalist shared tags: #elements, #html, #tier, #web
- tuts/html/elements/forms/fieldset shared tags: #elements, #html, #tier, #web