--- title: Slot Name is Reserved and Not Included in Slot Props impact: LOW impactDescription: Expecting 'name' in scoped slot props when it's reserved causes confusion type: gotcha tags: [vue3, slots, scoped-slots, reserved-props, naming] --- # Slot Name is Reserved and Not Included in Slot Props **Impact: LOW** - When using scoped slots, the `name` attribute on the `` element is reserved for identifying the slot. It is not passed as part of the slot props to the parent component. ## Task Checklist - [ ] Don't expect `name` in slot props - it's reserved - [ ] Use a different prop name if you need to pass a name value - [ ] Remember only explicitly bound attributes become slot props **Incorrect Expectation:** ```vue ``` ```vue ``` **If You Need to Pass a "Name" Value:** ```vue ``` ```vue ``` ## What Gets Passed as Slot Props | Attribute on `` | Passed to Parent? | |----------------------|-------------------| | `name` | No (reserved for slot identification) | | `:text="message"` | Yes, as `text` | | `:count="5"` | Yes, as `count` | | `v-bind="object"` | Yes, spreads object properties | | `class="..."` | No (not bound with `:`) | ## Multiple Named Slots Example ```vue ``` ```vue ``` ## Reference - [Vue.js Slots - Scoped Slots](https://vuejs.org/guide/components/slots.html#scoped-slots)