From harness-claude
Teaches named, scoped, and dynamic slots in Vue for building flexible, composable component APIs with fallback content, slot checking, and TypeScript considerations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:vue-slots-patternThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Use named, scoped, and dynamic slots to build flexible, composable component APIs
Use named, scoped, and dynamic slots to build flexible, composable component APIs
<slot> for the default slot, <slot name="header"> for named slots.<slot :item="item">.<template #slotName="{ item }">.<slot> tags for when the consumer does not fill the slot.<!-- Card.vue -->
<template>
<div class="card">
<div class="header"><slot name="header">Default Header</slot></div>
<div class="body"><slot /></div>
<div class="footer"><slot name="footer" /></div>
</div>
</template>
<!-- Consumer -->
<Card>
<template #header><h2>Custom Title</h2></template>
<p>Body content goes in the default slot</p>
</Card>
$slots to check if a slot was provided: v-if="$slots.header".<template #[dynamicSlotName]> for runtime-determined slots.Slots are Vue's content distribution mechanism, equivalent to React's children and render props. They allow parent components to inject content into child component templates. Named slots organize multiple content areas, and scoped slots pass data back to the parent for custom rendering.
Trade-offs:
<template #name> blocksdefineSlots()When NOT to use:
https://patterns.dev/vue/slots-pattern
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeProvides patterns for Vue components including props validation with TypeScript, defaults, emits, slots, and provide/inject. Use when building reusable Vue components.
Documents the renderless (headless) component pattern in Vue, where components manage behavior and expose it via scoped slots while consumers control all markup.
Guides Vue.js 3 Composition API patterns, component architecture, reactivity, Pinia state management, Vue Router, and Nuxt SSR. Activates for Vue, Nuxt, Vite, or Pinia projects.