LWCIntermediateslotscomposition
Design slot-based composition for flexible LWC layouts
Real World Scenario
Card component needs header footer actions slots reused across modules.
Expected Answer
• Named slots slot=header footer actions
• Default slot for body content
• Document slot contract in component guide
• SLDS spacing consistent across slot content
• Avoid slot overuse obscuring simple props
• Test slot content projection in Jest limited
Follow-Up Questions & Answers
Click to expand — each follow-up includes a direct, interview-ready answer
Direct answer: Named slots slot=header footer actions Also consider: Default slot for body content In practice: Document slot contract in component guide Balance speed of delivery with maintainability.
Architect Perspective
Slots enable composition without prop drilling—use for layout primitives.