SyntaxStudy
Sign Up
Vue.js Slots: Default, Named, and Scoped
Vue.js Beginner 1 min read

Slots: Default, Named, and Scoped

Slots are Vue's content-distribution API, allowing a parent component to inject markup into designated placeholders inside a child component. A child declares a slot with `` and can provide fallback content that renders when the parent supplies nothing. This makes components like cards, modals, and layouts fully customisable without exposing every internal detail as a prop. Named slots let a single child component expose multiple injection points. The parent uses `