Import from:
Slots System provides a mechanism for content distribution and management across components.
Content Distribution
Recast provides a slot system for content distribution:
Key Features
Named Slots
Unique slot identifiers
Optional render transforms
Hierarchical naming (e.g., "head.title")
Multiple Providers
Multiple content providers for same slot
Content deduplication via keys
Custom content merging logic
Scope Control
Global slots
Component-scoped slots
Inheritance control
Content Management
Content collection
Key-based deduplication
Transform pipeline
Injection system
Built-in Slots
Recast provides several built-in slots:
Render Process
During render, slots follow this process:
Slots collect content from Templates
Content is deduplicated by keys
Optional render transforms are applied
Content is injected into slot placeholders
Best Practices
Use meaningful slot names
Always provide keys for content deduplication
Use hierarchical naming for related slots
Keep transforms pure and simple
Consider scope when designing slot structure