Product Image
Interactive Demo
Try the interactive playground below - select different artworks and see the product mockup update in real-time:
ProductImage Props
artworkstringExample:
artwork="https://example.com/design.jpg"Perfect for quick demos and when you don't need placement-specific control.
placementsRecord<string, string>Example:
{ Front: '#FF0000', Back: 'https://image.jpg' }Note: For interactive artwork selection, use
ArtSelector component instead.imagesDesignElement[]Example:
[{ placement: 'Front', imageUrl: '/logo.png' }]variantIdstringmockupIdstringwidthnumber1400. Higher = better quality, slower load.effects{ grain?: 1 | 2 }{{ grain: 1 }}ar'16:9' | '2:3'16:9 - Landscape (default, no cropping)2:3 - Portrait (ideal for cards and mobile)Example:
ar="2:3"classNamestring"w-full rounded-lg"Product Props
productIdstringrequired"BEEB77"productDataCatalogProductchildrenReactNoderequiredSimple 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.
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, the mockup is automatically cropped to portrait orientation for optimal card layouts.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:
Installation
This CLI will guide you through setting up Merchify components in your project