Child theme template for StoreFuse that allows safe overrides across core updates.
This package provides a template for creating custom child themes that override components from @storefuse/theme-core without modifying core files. Your customizations will persist even when you update StoreFuse core packages.
The child theme uses a component registry pattern:
- Core theme exports a registry of all available components
- Child theme exports a registry with only the components you want to override
- StoreFuse resolves components: child first, then fallback to core
Create a custom component in src/components/:
// src/components/Header.tsx
export default function CustomHeader() {
return (
<header className="bg-purple-600 text-white">
<h1>My Custom Header!</h1>
</header>
);
}Add your component to the registry in src/index.ts:
export const childThemeRegistry = {
Header: () => import("./components/Header"),
// Add more component overrides here
};Update storefuse.config.ts:
export default defineStoreFuseConfig({
theme: {
core: "@storefuse/theme-core",
child: "@storefuse/theme-child-template", // or your custom child theme
},
// ... rest of config
});You can override any component from @storefuse/theme-core:
HeaderFooterNavigationLogoProductCardProductImageProductGridProductListProductDetailPageCategoryPageAddToCartButtonCartItemCartSummaryCartPageButtonInputBadgePriceContainerGridSection
You can use:
- Tailwind CSS (recommended, same as core theme)
- CSS Modules
- Plain CSS
- Any CSS-in-JS library
- Only override what you need - Don't copy all components
- Keep component props compatible - Match the core component's interface
- Use TypeScript - Get type safety for component props
- Test after core updates - Ensure your overrides still work
// src/components/ProductCard.tsx
import { Button, Price } from "@storefuse/theme-core";
interface ProductCardProps {
product: {
id: string;
name: string;
price: string;
image?: string;
};
}
export default function CustomProductCard({ product }: ProductCardProps) {
return (
<div className="border-4 border-pink-500 p-6 rounded-xl">
{product.image && (
<img src={product.image} alt={product.name} className="w-full rounded" />
)}
<h3 className="text-2xl font-bold mt-4">{product.name}</h3>
<Price value={product.price} className="text-pink-600 text-xl" />
<Button className="mt-4 bg-pink-500 hover:bg-pink-600">
Add to Cart
</Button>
</div>
);
}✅ Safe updates - Core package updates won't break your customizations
✅ No merge conflicts - Your files are separate from core
✅ Predictable overrides - Simple registry-based resolution
✅ Works on Vercel - No filesystem magic, just module imports
✅ Type-safe - Full TypeScript support
MIT