Overview
Theproduct-card snippet renders a product in a card layout with customizable children blocks. It’s used throughout the theme in product grids, featured product sections, and collection pages.
File Location: snippets/product-card.liquid
Parameters
object
required
The Shopify product object to display. Can be
null for placeholder rendering.string
required
HTML content to render inside the product card (typically captured from blocks).
object
The block object containing settings for styling and configuration.
number
Gap between product card children in pixels. Overrides block settings if provided.Default: Uses
block.settings.product_card_gapUsage
Basic Example
With Custom Gap
With Child Blocks
Features
View Transitions
Whensettings.transition_to_main_product is enabled, the product card supports smooth view transitions to product pages:
product-card.liquid
Quick Add Integration
The snippet automatically configures quick add functionality based on theme settings:product-card.liquid
Placeholder Support
The snippet automatically detects when it should render a placeholder:product-card.liquid
data-placeholder="true".
Styling
The product card applies several style utilities:Layout Classes
layout-panel-flex- Flexbox containerlayout-panel-flex--column- Vertical layoutproduct-grid__card- Grid-specific styling
Utility Classes
spacing-style- Applies padding from block settingsborder-style- Border styling from block settingsgap-style- Gap between childrensize-style- Width/height dimensions
Color Schemes
block_settings.inherit_color_scheme is false.
Custom Properties
The snippet generates CSS custom properties for responsive padding:Block Settings
When used in a block context, the snippet reads settings fromblock.settings:
Common Child Blocks
Product cards typically contain these child blocks:Product Card Gallery
Product Card Gallery
Product Title
Product Title
Price
Price
Swatches
Swatches
Accessibility
The product card includes a visually hidden link for screen readers:product-card.liquid
Examples
Related Snippets
- Price - Product pricing display
card-gallery.liquid- Product image gallery for cardsvariant-swatches.liquid- Variant selection UIquick-add.liquid- Quick add to cart functionality