AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Sfnext Components

skill-salesforcecommercecloud-b2c-developer-tooling-sfnext-components · by SalesforceCommerceCloud

Build UI components in Storefront Next using createPage HOC, Suspense/Await patterns, shadcn/ui, and Tailwind CSS v4. Use when creating page components, adding Suspense boundaries, integrating shadcn/ui, styling with Tailwind, or organizing component files. Covers server vs client rendering patterns and the cn() utility.

No reviews yet
0 installs
21 views
0.0% view→install

Install

$ agentstack add skill-salesforcecommercecloud-b2c-developer-tooling-sfnext-components

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-salesforcecommercecloud-b2c-developer-tooling-sfnext-components)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Sfnext Components? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Components Skill

This skill covers component development patterns in Storefront Next — createPage HOC, Suspense boundaries, shadcn/ui integration, and Tailwind CSS styling.

Page Component Pattern

Most routes export a default function component that receives loaderData as props:

import { Suspense } from 'react';
import { Await } from 'react-router';
import { SeoMeta } from '@/components/seo-meta';

type ProductPageData = {
    product: Promise;
    reviews: Promise;
};

export default function ProductPage({ loaderData }: { loaderData: ProductPageData }) {
    return (
        <>
            
            }>
                
                    {(product) => }
                
            
            }>
                
                    {(reviews) => }
                
            
        
    );
}

createPage HOC (Optional)

For pages needing standardized Suspense wrappers and page key management:

import { createPage } from '@/components/create-page';

export default createPage({
    component: ProductView,
    fallback: ,
});

Suspense Boundaries and Code Splitting

Use ` + for streaming loader data, and lazy()` for code-splitting heavy components:

import { lazy, Suspense } from 'react';

// Code-split a heavy component
const CustomerReviewsSection = lazy(() =>
    import('@/components/customer-reviews-section/customer-reviews-section')
);

export default function ProductPage({ loaderData }: { loaderData: ProductPageData }) {
    return (
        <>
            {/* Stream loader data */}
            }>
                
                    {(product) => }
                
            

            {/* Code-split component */}
            }>
                
            
        
    );
}

shadcn/ui Components

shadcn/ui provides pre-built accessible components. Add them via CLI:

npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add dialog

Rules:

  • Add components via CLI only (do not manually create files in src/components/ui/)
  • src/components/ui/ components are copied into your project and can be customized directly
  • Keep app/domain components outside src/components/ui/:
// Optional wrapper for app-specific styling
import { Button } from '@/components/ui/button';

export function PrimaryButton(props: React.ComponentProps) {
    return ;
}

Tailwind CSS Styling

Tailwind CSS v4 is the only permitted styling approach:

import { cn } from '@/lib/utils';

export function ProductCard({ featured }: { featured?: boolean }) {
    return (
        
            
                Product Name
            
        
    );
}

Rules:

  • Use Tailwind utility classes as the primary styling approach
  • Use cn() for conditional class merging
  • Follow mobile-first responsive design (md:, lg: breakpoints)
  • Prefer Tailwind over inline styles; inline styles are acceptable for truly dynamic values (e.g., backgroundColor from API data)
  • No CSS modules or separate CSS files
  • Custom global CSS only in src/app.css

Dark Mode

Theme variables automatically adapt via CSS variables:


    Click me

Responsive Design


    {products.map(p => )}

File Organization

src/components/product-tile/
├── index.tsx              # Component implementation
├── index.test.tsx         # Vitest unit tests
└── stories/
    ├── index.stories.tsx  # Storybook stories
    └── __snapshots__/     # Storybook snapshots (optional)

src/components/product-skeleton/
├── index.tsx              # Skeleton component (separate from main)
├── index.test.tsx
└── stories/
    └── index.stories.tsx

Best Practices

  1. Export default function components — Receive loaderData as props
  2. Granular Suspense boundaries — Show content progressively as data resolves
  3. Use lazy() for heavy components — Code-split below-the-fold or conditional UI
  4. Reusable skeleton components — Consistent loading states
  5. Colocate tests and stories — Keep test files next to source files
  6. TypeScript interfaces — Define proper types for all props

Related Skills

  • storefront-next:sfnext-data-fetching - Loader patterns that feed data to components
  • storefront-next:sfnext-testing - Writing Vitest tests and Storybook stories
  • storefront-next:sfnext-page-designer - Page Designer component integration
  • storefront-next:sfnext-i18n - Translating component text

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.