Setting the file. One moment.
Subchapter 2.18
references/auto-patterns-dashboard/custom-slots-override.mdMarkdown2 KBView on GitHub
REQUIRED: After creating slot files, you MUST update page.tsx to register them.
// Slot Component Signature
type SlotComponent = React.FC; // No props passed{
"type": "collectionPage",
"collectionPage": {
"components": [
{
"type": "custom",
"id": "topBanner" // Matches override key
},
{
"type": "collection",
"collection": { "collectionId": "items" }
}
]
}
}type is "custom" in components array THEN id MUST match a key in the slots override object.components array.components/slots/ folder.useSlots hook from components/slots/index.tsx.id in configuration exactly.// components/slots/TopBanner.tsx
import { Card, Text } from '@wix/design-system';
export const TopBanner = () => (
<Card>
<Card.Content>
<Text>Welcome to the dashboard</Text>
</Card.Content>
</Card>
);
// components/slots/index.tsx
import { TopBanner } from './TopBanner';
export const useSlots = () => ({ topBanner: TopBanner });CRITICAL: PRESERVE EXISTING OVERRIDES - Do NOT remove existing overrides. ADD this new one alongside them.
// 1. Add import (keep all existing imports)
import { useSlots } from './components/slots';
// 2. Add hook call (keep all existing hook calls)
const slots = useSlots();
// 3. Add slots to PatternsWizardOverridesProvider value (keep ALL existing overrides)