Product Image
Display product mockups with custom artwork rendered in real-time.
Interactive Demo
ProductImage is an optional React convenience over the mockup URL. Nothing here is required to render — it just renders the URL for you.Try the interactive playground below - select different artworks and see the product mockup update in real-time:
Loading playground...
ProductImage Props
artworkstringSimplest option: Single image URL applied to all placements.
Example:
Perfect for quick demos and when you don’t need placement-specific control.
Example:
artwork="https://example.com/design.jpg"Perfect for quick demos and when you don’t need placement-specific control.
placementsRecord<string, string>Simple multi-placement: Map placement names to colors or image URLs.
Example:
Note: For interactive artwork selection, use
Example:
{ Front: '#FF0000', Back: 'https://image.jpg' }Note: For interactive artwork selection, use
ArtSelector component instead.imagesDesignElement[]Advanced multi-placement: Array of design elements.
Example:
Example:
[{ placement: 'Front', imageUrl: '/logo.png' }]variantIdstringProduct variant ID. Auto-resolved from Product context if not provided.
mockupIdstringMockup view ID. Auto-resolved from Product context if not provided.
widthnumberImage resolution in pixels. Default:
1400. Higher = better quality, slower load.effects{ grain?: 1 | 2 }Visual effects:
{{ grain: 1 }}ar'16:9' | '2:3'Aspect ratio for mockup cropping.
Example:
16:9 - Landscape (default, no cropping)2:3 - Portrait (ideal for cards and mobile)Example:
ar="2:3"classNamestringCSS classes:
“w-full rounded-lg”Product Props
productIdstringrequiredProduct ID:
“BEEB77”productDataCatalogProductOptional pre-fetched data. Skips fetching when provided. Useful for SSR.
childrenReactNoderequiredComponents that use product context (ProductImage, ProductPrice, etc.).
Simple Artwork (Minimal Code)
The simplest way to display a product with artwork - just pass an image URL to the artwork prop. No ArtSelector needed, no array of artworks - the image automatically fills all placements on the product.
Loading playground...
Aspect Ratio (ar)
Control the aspect ratio of mockup images using the ar prop. This is useful when you need portrait-oriented images for product cards, mobile layouts, or social media.
Available Ratios
16:9- Landscape (default, no cropping)2:3- Portrait (crops sides, ideal for cards)
ProductCard uses 2:3 by default. When using
ProductCard, the mockup is automatically cropped to portrait orientation for optimal card layouts.Loading playground...
Multi-Placement Products
Some products like baseball caps have multiple placements where you can apply different artwork and colors:
- Image placements: Use
imagesprop with[{ placement, imageUrl }] - Color placements: Use
updateSelection({ Crown: '#ff0000' })fromuseProduct()
Interactive playground - customize the baseball cap with different artworks and colors:
Loading playground...
Installation
npm install @snowcone-app/ui
Styling — your Tailwind v4 build compiles it. In your global stylesheet, add
@import '@snowcone-app/ui/styles/globals.css' (brings in Tailwind, the theme tokens, and an @source for the package) plus an @source for your own code. In Next.js, also add transpilePackages: ['@snowcone-app/ui']. Add className="dark" on an ancestor for dark mode.
