From storefront-next
Integrates Page Designer with Storefront Next using React decorators, component registry, and Region rendering for merchant-editable pages.
How this skill is triggered — by the user, by Claude, or both
Slash command
/storefront-next:sfnext-page-designerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill covers Page Designer integration in Storefront Next — building merchant-editable pages with React components, decorators, and the Shopper Experience API.
This skill covers Page Designer integration in Storefront Next — building merchant-editable pages with React components, decorators, and the Shopper Experience API.
Page Designer is Commerce Cloud's visual editor for merchants. In Storefront Next, page structure (regions, components, attributes) is fetched from the Shopper Experience API and rendered via a component registry and <Region> component.
| Concept | Role |
|---|---|
| Page | Fetched in route loaders via fetchPageFromLoader(args, { pageId }) |
| Region | Named area rendered with <Region page={...} regionId="..." /> |
| Component | Content block with a typeId and attributes; registered in @/lib/registry |
| Registry | Static registry auto-generated by Vite plugin — do not edit by hand |
| Uses Page Designer | Does Not |
|---|---|
Home (homepage), Category/PLP, Search, Product/PDP | Cart, Checkout, Account, Auth |
import { fetchPageFromLoader, collectComponentDataPromises } from '@/lib/page-designer';
export function loader(args: LoaderFunctionArgs) {
const pagePromise = fetchPageFromLoader(args, { pageId: 'homepage' });
const componentData = collectComponentDataPromises(args, pagePromise);
return {
page: pagePromise,
componentData,
};
}
import { Region } from '@/components/region';
export default function HomePage({ loaderData: { page, componentData } }) {
return (
<div>
<Region page={page} regionId="hero" componentData={componentData}
fallbackElement={<HeroSkeleton />}
errorElement={<RegionError />} />
<Region page={page} regionId="content" componentData={componentData}
fallbackElement={<ContentSkeleton />} />
</div>
);
}
import { Component, AttributeDefinition, RegionDefinition } from '@salesforce/storefront-next-runtime/design';
@Component('hero-banner', {
name: 'Hero Banner',
description: 'Full-width banner with image and CTA'
})
class HeroBannerMeta {
@AttributeDefinition({ type: 'image' })
image: string;
@AttributeDefinition()
headline: string;
@AttributeDefinition({ type: 'url' })
ctaUrl: string;
@AttributeDefinition()
ctaText: string;
@AttributeDefinition({ type: 'boolean' })
fullWidth: boolean;
}
export default function HeroBanner({ image, headline, ctaUrl, ctaText, fullWidth }) {
return (
<div className={cn('relative', fullWidth && 'w-full')}>
<DynamicImage src={image} alt={headline} />
<h1>{headline}</h1>
{ctaUrl && <a href={ctaUrl}>{ctaText}</a>}
</div>
);
}
See Decorator Patterns Reference for all decorator options.
If a component needs server data (e.g., product carousel):
// Export a loader for the component
export function loader({ componentData, context }) {
const clients = createApiClients(context);
return clients.shopperProducts.getProducts({
params: { query: { ids: componentData.productIds } }
}).then(({ data }) => data);
}
// Optional fallback during loading
export function fallback() {
return <CarouselSkeleton />;
}
// Component receives data as prop
export default function ProductCarousel({ data, ...props }) {
return <Carousel products={data.products} />;
}
See Component Registry Reference for registry details.
Detect when running inside Page Designer:
import { isDesignModeActive, isPreviewModeActive } from '@salesforce/storefront-next-runtime/design/mode';
// In loaders
const isDesignMode = isDesignModeActive(request);
const isPreview = isPreviewModeActive(request);
// Root layout exposes pageDesignerMode in loader data
// 'EDIT' | 'PREVIEW' | undefined
Use the B2C DX MCP server tools for Page Designer development:
storefront_next_page_designer_decorator — Adds decorators to components (auto mode or interactive)storefront_next_generate_page_designer_metadata — Generates metadata JSON for Business Managercartridge_deploy — Deploys cartridge to Commerce Cloudstorefront_next_page_designer_decorator with autoMode)storefront_next_generate_page_designer_metadata)cartridge_deploy)typeIdpageDesignerMode is 'EDIT' or 'PREVIEW'storefront-next:sfnext-data-fetching - Loader patterns for Page Designer routesstorefront-next:sfnext-components - Component development patternsb2c:b2c-page-designer - Classic ISML Page Designer (NOT Storefront Next)npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin storefront-nextCreates and debugs Salesforce B2C Commerce Page Designer page types and component types with regions, attributes, and rendering scripts.
Builds UI components in Storefront Next using createPage HOC, Suspense/Await patterns, shadcn/ui, and Tailwind CSS v4. Includes server vs client rendering and cn() utility.
Build Next.js/React apps for Saleor storefronts/Apps with App Router conventions, server/client components, GraphQL integration, MacawUI, and Tailwind CSS.