Menu

Change language

GitHub repo

Product Detail Page

blockcommerce

Flagship e-commerce product detail page with multi-angle gallery, finish & cable selectors, stock urgency counter, warranty upsell, flash sale countdown bar, frequently bought together bundle, technical specs sheet, customer reviews breakdown, and community Q&A.

Installation

$npx shadcn-svelte@latest add https://uipkge.dev/r/svelte/product-detail-page.json
Manifest:https://uipkge.dev/r/svelte/product-detail-page.jsonInstalls to:src/lib/components/blocks/product-detail-page/

Variants

Loading interactive previews…

Schema

Type aliases exported from this item's source. Use these to shape the data you pass in.

ProductVariant
interface ProductVariant {
  id: string
  name: string
  colorHex: string
  sku: string
  inStock: boolean
  stockCount: number
  price: number
  originalPrice: number
  images: { id: string; url: string; alt: string }[]
}

Files installed (3)

  • src/lib/components/blocks/product-detail-page/ProductDetailPage.svelte2.6 kB
    <script lang="ts">
      import { ChevronRight } from '@lucide/svelte'
    
      // Import sub-blocks to compose the canonical enterprise PDP
      import FlashSaleOfferBar from '$lib/components/blocks/flash-sale-offer-bar/FlashSaleOfferBar.svelte'
      import TechnicalSpecsSheet from '$lib/components/blocks/technical-specs-sheet/TechnicalSpecsSheet.svelte'
      import ProductQaCommunity from '$lib/components/blocks/product-qa-community/ProductQaCommunity.svelte'
      import CustomerReviews from '$lib/components/blocks/customer-reviews/CustomerReviews.svelte'
      import FrequentlyBoughtTogether from '$lib/components/blocks/frequently-bought-together/FrequentlyBoughtTogether.svelte'
      import ProductGalleryBuyBox from './ProductGalleryBuyBox.svelte'
      import { variants } from './product-variants'
    
      let selectedVariantId = $state(variants[0]!.id)
    
      const currentVariant = $derived(variants.find((v) => v.id === selectedVariantId) ?? variants[0]!)
    
      function handleSelectVariant(id: string) {
        selectedVariantId = id
      }
    </script>
    
    <div data-slot="product-detail-page" class="bg-background text-foreground w-full space-y-10">
      <!-- Breadcrumb Navigation Bar -->
      <nav class="text-muted-foreground flex items-center gap-1.5 text-xs">
        <span class="hover:text-foreground cursor-pointer">Storefront</span>
        <ChevronRight class="size-3.5" />
        <span class="hover:text-foreground cursor-pointer">Pro Audio & Reference</span>
        <ChevronRight class="size-3.5" />
        <span class="hover:text-foreground cursor-pointer">Planar Magnetic</span>
        <ChevronRight class="size-3.5" />
        <span class="text-foreground font-medium">APX-950-PRO Reference Monitor</span>
      </nav>
    
      <!-- Main Hero Split: Gallery & Buy Box -->
      <ProductGalleryBuyBox {selectedVariantId} onSelectVariant={handleSelectVariant} />
    
      <!-- Section 2: Flash Sale & Multi-Buy Tier Deal Bar -->
      <div class="space-y-3">
        <FlashSaleOfferBar
          saleTitle="Audio Pro Week: Limited Master Batch 04"
          claimedPercent={82}
          itemsLeft={currentVariant.stockCount}
        />
      </div>
    
      <!-- Section 3: Frequently Bought Together Bundle -->
      <div class="space-y-4">
        <FrequentlyBoughtTogether />
      </div>
    
      <!-- Section 4: Engineering & Technical Specifications Sheet -->
      <div class="space-y-4">
        <TechnicalSpecsSheet modelNumber="APX-950-PRO" revision="Studio Edition 2026" />
      </div>
    
      <!-- Section 5: Verified Customer Reviews & Photo Breakdown -->
      <div class="space-y-4">
        <CustomerReviews />
      </div>
    
      <!-- Section 6: Customer & Staff Q&A Community -->
      <div class="space-y-4">
        <ProductQaCommunity productName="Apex Pro Reference Planar Headphones" />
      </div>
    </div>
    
  • src/lib/components/blocks/product-detail-page/ProductGalleryBuyBox.svelte12.9 kB
  • src/lib/components/blocks/product-detail-page/product-variants.ts2.8 kB

Raw manifest:https://uipkge.dev/r/svelte/product-detail-page.json