Skip to main content

html-tags.com

<slot>

A placeholder inside shadow DOM that light-DOM children fill.

Baseline: Widely available · Scripting

When to use it

In web components: named slots receive elements with matching slot attributes; default slot takes the rest.

When not to

Meaningless outside a shadow tree — it's web-component plumbing, not page content.

Key attributes

name
the slot's name

Example

<template shadowrootmode='open'>
  <header><slot name='title'>Untitled</slot></header>
  <slot></slot>
</template>
Source — this snippet needs a fuller context to render.

Authoritative references