← All notes

Vue slots let a parent pass template content into a child

Answer: Components can accept props, but they can also accept template content. A parent may pass a template fragment to a child, and the child renders that fragment in its own template.

Outlets

The <slot> element is a slot outlet: the place where the parent-provided slot content is rendered.

Runtime

In runtime-core, the slots object tracks the slot owner instance (attached during normalizeChildren when the component vnode is created). Compiler-generated slots also carry an optimization hint on the slots object itself. When default slot content is not a function, Vue warns and still normalizes it onto instance.slots.default.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Vue.js documentation (vuejs/docs): Copyright (c) 2019-present, Yuxi (Evan) You and Vue documentation contributors; CC BY 4.0, text only (https://raw.githubusercontent.com/vuejs/docs/main/LICENSE). Vue.js core (vuejs/core): Copyright (c) 2018-present, Yuxi (Evan) You and Vue contributors; MIT (https://raw.githubusercontent.com/vuejs/core/main/LICENSE). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Vue.js docs, Slots, CC BY 4.0, text only (vuejs/docs); Vue.js core, runtime-core componentSlots, MIT (vuejs/core). Notices: Vue.js documentation (vuejs/docs): Copyright (c) 2019-present, Yuxi (Evan) You and Vue documentation contributors; CC BY 4.0, text only (https://raw.githubusercontent.com/vuejs/docs/main/LICENSE). Vue.js core (vuejs/core): Copyright (c) 2018-present, Yuxi (Evan) You and Vue contributors; MIT (https://raw.githubusercontent.com/vuejs/core/main/LICENSE).

Cite this

Permanent ID: iil:note:2n40k3d6

iinventedlight. 2026. "Vue slots let a parent pass template content into a child." iinventedlight Library, iil:note:2n40k3d6, version of 2026-11-10. https://iinventedlight.com/library/notes/vue-slots/. License: CC-BY-4.0.

@misc{iil_note_2n40k3d6,
  author = {{iinventedlight}},
  title = {{Vue slots let a parent pass template content into a child}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-10},
  url = {https://iinventedlight.com/library/notes/vue-slots/},
  note = {Permanent ID iil:note:2n40k3d6. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/vue-slots.md.